Why do I get the message "Single-stepping before exiting ... that has no line number information" in GDB?

I compiled my C program using gcc 4.4.1 using the -g flag, but when I try to execute one of my functions in gdb version 7.0 >, I get the message:

 "Single stepping until exit from function _DictionaryTree_getNodeList, which has no line number information." 

Can someone tell me why this is happening?

+35
c gcc gdb
Jan 31 '10 at 1:55
source share
7 answers

Just guessing, but is it _DictionaryTree_getNodeList in another file that has not been compiled with -g?

+24
Jan 31 '10 at 1:58
source share
β€” -

I had the same problem, but in my case adding -g to the compiler was not enough, so I used -ggdb as suggested by Manav.

+8
Nov 23 '12 at 19:42
source share

In my case, the problem was version skew between gcc and gdb .

After landing here from the search, and none of these answers match my situation, I realized that (due to aliases / symbolic links / Makefile / environment variables) I accidentally used the new GCC (4.8.x) and the older GDB ( 7.2). Fix a problem with the new version of GDB (7.8). For some reason, using the newer GCC and the older GDB did not help.

+4
Jun 01 '15 at
source share

I also had this error message, but the source of my problem was different. If someone still has problems, make sure you have #include <stdio.h> in your file, with the appropriate brackets around stdio.h (the text message would not be displayed if it was around stdio.h ) .

+1
Aug 28 '14 at 16:37
source share

I had the same problem when I compiled the file using the -g option and without the -g option. For one of the files, gdb displayed the line number without any problems (even when it was compiled without the -g option). And for another file, I had to explicitly specify the -g flag ...

Any ideas as to whether the source file can be loaded at runtime with cross-references to GDB would be a good solution ... by matching strings to addresses: D.

0
Oct 21 '13 at 7:21
source share

I had this problem because I was debugging the shared library without specifying LD_LIBRARY_PATH to fix the location using debugging end elements.

you can use

 export LD_LIBRARY_PATH=<location of the debug build of the .so file>:$LD_LIBRARY_PATH 

Hope this helps someone

0
May 19 '17 at 14:30
source share

I had the same problem even though I already wrote with -g2 . Changing it to -g3 did the trick.

0
Jun 25 '17 at 20:34 on
source share



All Articles