public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/29614]  New: DWARF information for function static variable is missing after unrelated code addition
@ 2006-10-27 12:43 fnf at specifixinc dot com
  2006-10-28 18:49 ` [Bug debug/29614] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: fnf at specifixinc dot com @ 2006-10-27 12:43 UTC (permalink / raw)
  To: gcc-bugs

A bunch of tests in the gdb testsuite dealing with static variables inside
function scopes have started failing recently with the latest development gcc. 
I simplified the test case down to a small program that shows that simply
adding a small bit of unrelated code causes the DWARF information to disappear.
 Here is a typescript:

Script started on Tue 24 Oct 2006 08:58:44 PM MST
$ cat b.c
int bar ()
{
  static int funclocal = 4;     /* In data section */
  return funclocal;
}

int foo ()
{
  static int funclocal = 3;     /* In Data section */
  return funclocal;
}

#ifdef EXPOSEBUG
void bell ()
{
  static int usedval;
}
#endif

main ()
{
  extern void exit (int);
  exit (bar() + foo());
}
$ gcc -g -o b b.c
$ readelf --debug-dump b | grep funclocal
     DW_AT_name        : (indirect string, offset: 0x0): funclocal
     DW_AT_name        : (indirect string, offset: 0x0): funclocal
     DW_AT_name        : (indirect string, offset: 0x0): funclocal
  0x00000000 66756e63 6c6f6361 6c00              funclocal.
$ gcc -DEXPOSEBUG -g -o b b.c
$ readelf --debug-dump b | grep funclocal
     DW_AT_name        : funclocal
$ gdb b
GNU gdb 6.5.50.20060923-cvs
Copyright (C) 2006 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"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) br foo
Breakpoint 1 at 0x8048361: file b.c, line 10.
(gdb) br bar
Breakpoint 2 at 0x8048357: file b.c, line 4.
(gdb) run
Starting program:
/media/backups/new/build/specifix/experimental/i686-pc-linux-gnu/gdb/gdb/testsuite/b

Breakpoint 2, bar () at b.c:4
4         return funclocal;
(gdb) p funclocal
No symbol "funclocal" in current context.
(gdb) c
Continuing.

Breakpoint 1, foo () at b.c:10
10        return funclocal;
(gdb) p funclocal
$1 = 3
(gdb) quit
The program is running.  Exit anyway? (y or n) y
$ exit

Script done on Tue 24 Oct 2006 08:59:51 PM MST


-- 
           Summary: DWARF information for function static variable is
                    missing after unrelated code addition
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fnf at specifixinc dot com
 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=29614


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-03-05 23:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-27 12:43 [Bug debug/29614] New: DWARF information for function static variable is missing after unrelated code addition fnf at specifixinc dot com
2006-10-28 18:49 ` [Bug debug/29614] [4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2006-12-21 23:20 ` sje at cup dot hp dot com
2006-12-22  0:54 ` hubicka at ucw dot cz
2007-02-19 20:36 ` mmitchel at gcc dot gnu dot org
2007-02-20 21:40 ` patchapp at dberlin dot org
2007-02-24  0:11 ` sje at gcc dot gnu dot org
2007-03-05 23:52 ` [Bug debug/29614] [4.2 " sje at gcc dot gnu dot org
2007-03-05 23:56 ` pinskia 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).