[Bug debug/11508] New: gcc does not output correct debuging file information for #included variables
msimons at simons-clan dot com
gcc-bugzilla@gcc.gnu.org
Sat Jul 12 19:45:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11508
Summary: gcc does not output correct debuging file information
for #included variables
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: msimons at simons-clan dot com
CC: gcc-bugs at gcc dot gnu dot org
I have found a problem with printing source code lines for variable
declarations from inside gdb. I think the problem is that gcc
stores the wrong file name information for the variable declarations
which come from #include, but the problem *could* be gdb not handling
the information correctly.
What is interesting is that function line numbers *are* correctly handled.
Tested with gcc and g++: 2.95, 2.96, 3.3, on i386/i686 linux (debian and
redhat). Most testing has been done with gcc 3.3.
I have tried various -g options like -gstabs -gstabs+ -gdwarf -gdwarf-2,
none appear to help (some prevent gdb from finding variable line information
at all).
gcc -g test.c -o test1
gdb -q test1
===
(gdb) set listsize 3
(gdb) l foo
8
9 int foo;
10
(gdb) l bar
2 #include "test.h"
3 #if zap
4 /* this */
(gdb) l func
5 int func(void)
6 {
7 return 23;
===
You can see func is correctly displayed.
bar is located on line three of test.h, if I move it around in test.h the
lines displayed from from test.c changes.
I don't understand the .stabs directives in the assembly output, but it
seems like all global variables are put at the end of the output after
.stabs directives have said test.c is the current file, and file information
is omitted.
I don't know of a work around for this problem.
More information about the Gcc-bugs
mailing list