This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

debug/5778: File for instruction incorrect when using #include



>Number:         5778
>Category:       debug
>Synopsis:       File for instruction incorrect when using #include
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 25 10:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Francisco Moraes
>Release:        gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-85)
>Organization:
>Environment:
RedHat 7.0 with GDB 5.1.1
>Description:
Using included files for function, GCC seems to generate incorrect file information for the addresses coming from the included file. GDB doesn't seem to be at fault as a cross-compiled GCC/GDB (ARM ELF32/DWARF) seems to work fine.

The problem is either at GCC generated debug information or GDB reading the debug information.
>How-To-Repeat:
Unzip and compile:
gcc -g -o test test.cpp

Debug using GDB, break at main, and step a couple of lines. This is the output from GDB:

GNU gdb 5.1.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) break main
Breakpoint 1 at 0x8048436: file test.cpp, line 3.
(gdb) run
Starting program: /root/test

Breakpoint 1, main (argc=1, argv=0xbffffc94) at test.cpp:3
3       #include "demo.cpp"
(gdb) n
4       }
(gdb) n
Line number 5 out of range; test.cpp has 4 lines.
(gdb)
>Fix:
Correct the line generation table.
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]