简体   繁体   中英

how to get debug symbols in automake c project?

I tried to degub c automake project with Cygwin in Windows. I ran the following:

./configure CFLAGS="-g -o0"  
make

after that, I loaded

gdb file src/slim.exe

and it says

no debugging symbols found

file out says:

 file src/slim.exe
 src/slim.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS  Windows

when I check with "./configure -help", it shows that --enable-debug no at default.

How can I fix it?

What you have to do is search for *.sym (Symbol files) in obj directory

Then

gdb 

gdb>attach <process -id>

gdb> symbol-file <path of symbol file>

Just had a similar issue when building with the makepkg from Arch Linux, it turns out that you can disable strip from the makepkg.conf configuration, just add a ! before the strip option in the OPTION property, for example:

OPTIONS=(!strip docs !libtool !staticlibs emptydirs zipman purge !upx !debug)

Edit: I realize this likely will not solve the OP problem, but I got her searching for something like it, and thus thought that the information may be useful for others searching for the same keywords.

I also had this issue and found this entry. I finally figured it out and wanted to add the information here for others as a possible cause:

The use of libtool will not give you an exe file you can debug. You instead use:

libtool --mode=execute gdb --args filename

I found this when I was looking in the FreeBSD environment and eventually discovered that my program was actually a shell script.

For cygwin you get an exe which is described in the question and cannot tell what the issue might be. The file command gives the same as above for example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM