[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with line n.o's
From: |
Michael Elizabeth Chastain |
Subject: |
Re: Problem with line n.o's |
Date: |
Fri, 19 Sep 2003 14:12:18 -0400 |
Hello,
> Version of GDB : GNU gdb 5.3
> Type of Machine: Red-hat Linux 6.0 on i686
> What Compiler was used to compiler GDB: egcs-2.91.66
> What compiler (and its version) was used to compile the program you are
> debugging: egcs-2.91.66
This looks like a well-known problem with the stabs+ debugging
format.
On i686-pc-linux-gnu, gcc and gdb support two debugging formats: dwarf-2
and stabs+. I don't know about egcs 2.91.66 in particular, but I do
know that gcc version 2.95.3 defaulted to stabs+.
The problem is that stabs+ has a 16-bit field in the debugging info
to hold the line number. So the line number information has already
been truncated by the time that gdb gets it.
Solution: use the dwarf-2 debug format rather than stabs+.
You can do this by building your program with "-gdwarf-2".
You have to do this when compiling each source file and also
when linking the executable program.
dwarf-2 is the default debug format with gcc 3.2 or later.
Also, Red Hat Linux 6 and egcs 2.91.66 are very old!
You might want to upgrade.
Hope this helps,
Michael C
GDB QA Guy