public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/13365] New: Missing DWARF line info for empty function
@ 2003-12-09 4:32 gcc-bugzilla at gcc dot gnu dot org
2003-12-09 5:22 ` [Bug debug/13365] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2003-12-09 4:32 UTC (permalink / raw)
To: gcc-bugs
Current CVS gcc generates DWARF line number information that is incomplete, a regression
from earlier gcc versions, such as the native RedHat 9 gcc.
Environment:
System: Linux fred.ninemoons.com 2.4.20-20.9 #1 Mon Aug 18 11:27:43 EDT 2003 i686 athlon i386 GNU/Linux
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /src/sourceware/gcc/gcc/configure -v --prefix=/usr/local/sourceware --enable-languages=c,c++ : (reconfigured) /src/sourceware/gcc/gcc/configure -v --prefix=/usr/local/sourceware --enable-languages=c
How-To-Repeat:
I decided to investigate the following failure in the gdb testsuite
funcargs.exp test, that has led to what I believe is a gcc bug in the
DWARF debug information generated by the latest compiler (3.4
20031207):
FAIL: gdb.base/funcargs.exp: continue to call6k
The problem can reproduced using:
void foo ()
{
}
void bar ()
{
static int dummy = 0;
}
main ()
{
foo ();
bar ();
}
If I debug the above program compiled with the 20031207 gcc, gdb
prints it's breakpoint stop message differently for foo than for bar:
$ /usr/local/sourceware/bin/gcc -g -o x x.c
$ gdb -q x
(gdb) br foo
Breakpoint 1 at 0x8048327: file x.c, line 2.
(gdb) bar bar
Undefined command: "bar". Try "help".
(gdb) br bar
Breakpoint 2 at 0x804832c: file x.c, line 8.
(gdb) run
Starting program: /tmp/x
Breakpoint 1, 0x08048327 in foo () at x.c:2
2 {
(gdb) c
Continuing.
Breakpoint 2, bar () at x.c:8
8 }
However debugging the program when compiled with the native RedHat 9 gcc
produces different, and correct, results:
$ /usr/bin/gcc -g -o x x.c
$ gdb -q x
(gdb) br foo
Breakpoint 1 at 0x80482f7: file x.c, line 3.
(gdb) br bar
Breakpoint 2 at 0x80482fc: file x.c, line 8.
(gdb) run
Starting program: /tmp/x
Breakpoint 1, foo () at x.c:3
3 }
(gdb) c
Continuing.
Breakpoint 2, bar () at x.c:8
8 }
(gdb)
If you dump the debug line info for the 20031207 gcc compiled executable
using "readelf --debug-dump=line x" you get:
Line Number Statements:
Extended opcode 2: set Address to 0x8048324
Special opcode 6: advance Address by 0 to 0x8048324 and Line by 1 to 2
Special opcode 79: advance Address by 5 to 0x8048329 and Line by 4 to 6
Special opcode 49: advance Address by 3 to 0x804832c and Line by 2 to 8
Special opcode 36: advance Address by 2 to 0x804832e and Line by 3 to 11
Advance PC by constant 17 to 0x804833f
Special opcode 160: advance Address by 11 to 0x804834a and Line by 1 to 12
Special opcode 76: advance Address by 5 to 0x804834f and Line by 1 to 13
Special opcode 76: advance Address by 5 to 0x8048354 and Line by 1 to 14
Advance PC by 2 to 8048356
Extended opcode 1: End of Sequence
Dumping the debug line info for the native RedHat 9 gcc compiled executable
produces:
Line Number Statements:
Extended opcode 2: set Address to 0x80482f4
Special opcode 6: advance Address by 0 to 0x80482f4 and Line by 1 to 2
Special opcode 48: advance Address by 3 to 0x80482f7 and Line by 1 to 3 <=== NOTE
Special opcode 36: advance Address by 2 to 0x80482f9 and Line by 3 to 6
Special opcode 49: advance Address by 3 to 0x80482fc and Line by 2 to 8
Special opcode 36: advance Address by 2 to 0x80482fe and Line by 3 to 11
Special opcode 230: advance Address by 16 to 0x804830e and Line by 1 to 12
Special opcode 76: advance Address by 5 to 0x8048313 and Line by 1 to 13
Special opcode 76: advance Address by 5 to 0x8048318 and Line by 1 to 14
Advance PC by 2 to 804831a
Extended opcode 1: End of Sequence
Note that the 20031207 compiled debug info is missing the line number
info corresponding to "advance Address by 3 to 0x80482f7 and Line by 1
to 3" that is in the RedHat 9 executable.
For more in depth discussion of the gdb issues see the thread at:
http://sources.redhat.com/ml/gdb-patches/2003-12/msg00253.html
-Fred
--
Summary: Missing DWARF line info for empty function
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fnf at ninemoons dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF line info for empty function
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
@ 2003-12-09 5:22 ` pinskia at gcc dot gnu dot org
2003-12-09 5:24 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-09 5:22 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-12-09 05:22 -------
Confirmed, a regression from 3.2.3.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |wrong-code
Last reconfirmed|0000-00-00 00:00:00 |2003-12-09 05:22:02
date| |
Summary|Missing DWARF line info for |[3.3/3.4 Regression] Missing
|empty function |DWARF line info for empty
| |function
Target Milestone|--- |3.3.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF line info for empty function
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
2003-12-09 5:22 ` [Bug debug/13365] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
@ 2003-12-09 5:24 ` pinskia at gcc dot gnu dot org
2003-12-23 22:09 ` janis187 at us dot ibm dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-12-09 5:24 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-12-09 05:24 -------
Should note I also tested 3.3.1 where the problem is too.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF line info for empty function
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
2003-12-09 5:22 ` [Bug debug/13365] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
2003-12-09 5:24 ` pinskia at gcc dot gnu dot org
@ 2003-12-23 22:09 ` janis187 at us dot ibm dot com
2004-01-10 15:53 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: janis187 at us dot ibm dot com @ 2003-12-23 22:09 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From janis187 at us dot ibm dot com 2003-12-23 20:00 -------
The regression in PR 13365 was introduced or exposed on mainline with
this patch:
Sat Feb 22 12:42:16 CET 2003 Jan Hubicka <jh@suse.cz>
* c-decl.c (c_expand_body_1): Fix.
and on the 3.3-branch with:
2003-06-12 Jakub Jelinek <jakub@redhat.com>
* c-decl.c (c_expand_body): Save input_filename and lineno,
set it before tree inlining and restore before return.
The regression hunts took place on i686-pc-linux-gnu using the
submitter's test case compiled with -g.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at redhat dot com, jh
| |at suse dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF line info for empty function
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
` (2 preceding siblings ...)
2003-12-23 22:09 ` janis187 at us dot ibm dot com
@ 2004-01-10 15:53 ` pinskia at gcc dot gnu dot org
2004-01-10 16:23 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-10 15:53 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |minor
Keywords|wrong-code |wrong-debug
Target Milestone|3.3.3 |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF line info for empty function
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
` (3 preceding siblings ...)
2004-01-10 15:53 ` pinskia at gcc dot gnu dot org
@ 2004-01-10 16:23 ` pinskia at gcc dot gnu dot org
2004-01-11 5:21 ` drow at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-10 16:23 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-10 16:23 -------
Not worth fixing as line info for empty functions can be either place.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF line info for empty function
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
` (4 preceding siblings ...)
2004-01-10 16:23 ` pinskia at gcc dot gnu dot org
@ 2004-01-11 5:21 ` drow at gcc dot gnu dot org
2004-01-25 3:09 ` [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF2 " pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: drow at gcc dot gnu dot org @ 2004-01-11 5:21 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From drow at gcc dot gnu dot org 2004-01-11 05:21 -------
That's got nothing to do with it. The issue is not which line the second
line note specifies but that there be a second line note marking the end
of the prologue.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WONTFIX |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF2 line info for empty function
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
` (5 preceding siblings ...)
2004-01-11 5:21 ` drow at gcc dot gnu dot org
@ 2004-01-25 3:09 ` pinskia at gcc dot gnu dot org
2004-01-27 5:55 ` [Bug debug/13365] [3.3 " pinskia at gcc dot gnu dot org
2004-01-29 5:02 ` gdr at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-25 3:09 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-25 03:09 -------
Fixed in 3.5 at least:
Line Number Statements:
Extended opcode 2: set Address to 0x8048324
Special opcode 6: advance Address by 0 to 0x8048324 and Line by 1 to 2
Special opcode 47: advance Address by 3 to 0x8048327 and Line by 0 to 2 <-- note
Special opcode 37: advance Address by 2 to 0x8048329 and Line by 4 to 6
Special opcode 49: advance Address by 3 to 0x804832c and Line by 2 to 8
Special opcode 36: advance Address by 2 to 0x804832e and Line by 3 to 11
Advance PC by constant 17 to 0x804833f
Special opcode 160: advance Address by 11 to 0x804834a and Line by 1 to 12
Special opcode 76: advance Address by 5 to 0x804834f and Line by 1 to 13
Special opcode 76: advance Address by 5 to 0x8048354 and Line by 1 to 14
Advance PC by 2 to 8048356
Extended opcode 1: End of Sequence
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[3.3/3.4/3.5 Regression] |[3.3/3.4 Regression] Missing
|Missing DWARF line info for |DWARF2 line info for empty
|empty function |function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/13365] [3.3 Regression] Missing DWARF2 line info for empty function
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
` (6 preceding siblings ...)
2004-01-25 3:09 ` [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF2 " pinskia at gcc dot gnu dot org
@ 2004-01-27 5:55 ` pinskia at gcc dot gnu dot org
2004-01-29 5:02 ` gdr at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-27 5:55 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-27 05:55 -------
This also works in 3.4 now too.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |NEW
Known to work|3.5.0 |3.2.3 3.5.0 3.4.0
Summary|[3.3/3.4 Regression] Missing|[3.3 Regression] Missing
|DWARF2 line info for empty |DWARF2 line info for empty
|function |function
Target Milestone|3.4.0 |3.3.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug debug/13365] [3.3 Regression] Missing DWARF2 line info for empty function
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
` (7 preceding siblings ...)
2004-01-27 5:55 ` [Bug debug/13365] [3.3 " pinskia at gcc dot gnu dot org
@ 2004-01-29 5:02 ` gdr at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: gdr at gcc dot gnu dot org @ 2004-01-29 5:02 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From gdr at gcc dot gnu dot org 2004-01-29 05:02 -------
Unlikely to be fixed in 3.3.x
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13365
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2004-01-29 5:02 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-09 4:32 [Bug debug/13365] New: Missing DWARF line info for empty function gcc-bugzilla at gcc dot gnu dot org
2003-12-09 5:22 ` [Bug debug/13365] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
2003-12-09 5:24 ` pinskia at gcc dot gnu dot org
2003-12-23 22:09 ` janis187 at us dot ibm dot com
2004-01-10 15:53 ` pinskia at gcc dot gnu dot org
2004-01-10 16:23 ` pinskia at gcc dot gnu dot org
2004-01-11 5:21 ` drow at gcc dot gnu dot org
2004-01-25 3:09 ` [Bug debug/13365] [3.3/3.4 Regression] Missing DWARF2 " pinskia at gcc dot gnu dot org
2004-01-27 5:55 ` [Bug debug/13365] [3.3 " pinskia at gcc dot gnu dot org
2004-01-29 5:02 ` gdr at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).