gcc (GCC) 4.6.0 GNU gdb (GDB) Fedora (7.2.90.20110525-38.fc15)
I recently had a problem when I was trying to debug my problem using gdb. When I uploaded my binary, gdb complained: "No debugging symbols found"
So, when I did the following:
nm ass1
I got the following result (sample only)
00000000006026e0 t __init_array_end 00000000006026d0 t __init_array_start 00000000004020e0 T __libc_csu_fini 0000000000402050 T __libc_csu_init U __libc_start_main@ @GLIBC_2.2.5 00000000006029ec A _edata 0000000000602b28 A _end 000000000040212c T _fini 0000000000401420 T _init 0000000000401610 T _start U atoi@ @GLIBC_2.2.5 000000000040163c t call_gmon_start 0000000000602b10 b completed.5886 00000000006029e8 W data_start 0000000000602b18 b dtor_idx.5888 00000000004016d0 t frame_dummy 00000000004016f4 T main
The problem was that I forgot to add -g. So I decided to compile with -g and run nm again. I got simliar output, this contains the debug symbols that I used -g and gdb did not complain this time:
U __libc_start_main@ @GLIBC_2.2.5 00000000006029ec A _edata 0000000000602b28 A _end 000000000040212c T _fini 0000000000401420 T _init 0000000000401610 T _start U atoi@ @GLIBC_2.2.5 000000000040163c t call_gmon_start 0000000000602b10 b completed.5886 00000000006029e8 W data_start 0000000000602b18 b dtor_idx.5888 00000000004016d0 t frame_dummy 00000000004016f4 T main w pthread_cancel
In addition, the binary size is larger. I could notice any use of nm. I wonder what should I look for? What do debug symbols look like?
Thanks so much for any suggestions,
ant2009
source share