簡體   English   中英

使用gdb進行調試時找不到調試符號

[英]No debugging symbol found in debugging with gdb

我正在使用gdb調試C4.5代碼,但出現錯誤

GNU gdb (Ubuntu 7.7-0ubuntu3.1) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./consult...(no debugging symbols found)...done.

C4.5的make文件在CFLAG中具有-g,並且附加了整個文件。 我遵循了一些討論以進行類似的討論。 但是還是有問題的。

Makefile
CFLAGS = -g -O2    
core.ln = \
    getnames.ln getdata.ln trees.ln getopt.ln header.ln    
trees.ln = \
    besttree.ln build.ln info.ln discr.ln contin.ln subset.ln\
    prune.ln stats.ln st-thresh.ln classify.ln confmat.ln\
    sort.ln $(core.ln)    
rules.ln = \
    rules.ln genlogs.ln genrules.ln makerules.ln prunerule.ln\
    siftrules.ln testrules.ln stats.ln confmat.ln sort.ln $(core.ln)    
core = \
    getnames.o getdata.o trees.o getopt.o header.o    
trees = \
    besttree.o build.o info.o discr.o contin.o subset.o prune.o\
    stats.o st-thresh.o classify.o confmat.o sort.o $(core)    
rules = \
    rules.o genlogs.o genrules.o makerules.o prunerule.o\
    siftrules.o testrules.o stats.o confmat.o sort.o $(core)    
c4.5:   c4.5.o $(trees)
cc -o c4.5 c4.5.o $(trees) -lm   
c4.5gt:
    cat defns.i types.i\
        c4.5.c\
        besttree.c build.c info.c discr.c contin.c subset.c\
        prune.c stats.c st-thresh.c confmat.c sort.c\
        getnames.c getdata.c classify.c trees.c header.c\
        | egrep -v 'defns.i|types.i|extern.i|buildex.i' >c4.5gt.c
    cc -O4 -o c4.5gt c4.5gt.c -lm
    rm c4.5gt.c  
c4.5rules: c4.5rules.o $(rules)
    cc -o c4.5rules c4.5rules.o $(rules) -lm  

c4.5rulesgt:
    cat defns.i types.i\
        c4.5rules.c\
        rules.c genlogs.c genrules.c makerules.c prunerule.c\
        siftrules.c testrules.c stats.c confmat.c sort.c\
        getnames.c getdata.c classify.c trees.c header.c\
        | egrep -v 'defns.i|types.i|extern.i|rulex.i' >c4.5rulesgt.c
    cc -O4 -o c4.5rulesgt c4.5rulesgt.c -lm
    rm c4.5rulesgt.c    
consult: consult.o userint.o $(core)
    cc -o consult consult.o userint.o $(core)    
consultr: consultr.o rules.o userint.o $(core)

    cc -o consultr consultr.o rules.o userint.o $(core)


.c.o:
    cc $(CFLAGS) -c $<


all:
    make c4.5
    make c4.5rules
    make consult
    make consultr
    cc -o xval-prep xval-prep.c
    cc -o average average.c -lm


$(trees): defns.i types.i extern.i
$(rules): defns.i types.i extern.i

當我檢查文件咨詢是否已剝離/未剝離時,它不會被剝離。 我還需要添加什么到make文件中,以便可以使用gdb調試Consult api? 謝謝

這有效

cc -ggdb3 -O0 -std=c11  -Wshadow ab.c -o ab


taras@taras: $ gdb ./ab

GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
...

Reading symbols from ./ab...done.

Starting program: /home/taras/ab 7

(gdb) b 7

Breakpoint 1 at 0x40052e: file ab.c, line 7.

(gdb) r

Starting program: /home/taras/ab 7

Breakpoint 1, main () at ab.c:7

7               int n = 0, m = 0;

(gdb) n

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM