This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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]

some header sources not seen from gdb


When compiling with gcc 3.2.1 and 3.2.2, I no longer
can see header files among my sources from gdb.  When
I do "info sources", I don't see my header files.
Also, when I try "list hello.h:1", gdb says it can't
find my header file.  In gcc 2.96, I was able to
see my headers from gdb.  How can I get the old
results using gcc 3.*?  Below is an example of
what I'm talking about.  Thanks in advance!


                         Dave

{>:25} more hello.c
#include <stdio.h>
#include "hello.h"
main()
{
  printf("%s", hellomessage);

}
{>:26} more hello.h
const char *hellomessage = "Hello world\n";
{>:27} gcc --version
2.96
{>:28} gccx --version
gccx (GCC) 3.2.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

{>:29}  gcc -g -o hello2.96 hello.c
{>:30} gccx -g -o hello3.2.1 hello.c
{>:31} gdb hello2.96
GNU gdb Red Hat Linux (5.1.90CVS-5)
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 "i386-redhat-linux"...
(gdb) list hello.h:1
1       const char *hellomessage = "Hello world\n";
(gdb) quit
{>:32} gdb hello3.2.1 
GNU gdb Red Hat Linux (5.1.90CVS-5)
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 "i386-redhat-linux"...
(gdb) list hello.h:1
No source file named hello.h.
(gdb) quit

By the way, I originally thought this was a
gcc issue, not a gdb issue, but I posted to
the gcc-help mailing list and received no
responses then submitted a gcc bug report
to redhat bugzilla and had it re-assigned
to the gdb module.  The person who reassigned
it had the following comments:

hello.h appears to be both in .debug_line file table:
     readelf -wl hello | grep 'hello\.'
       1     0       0       0       hello.c
       2     0       0       0       hello.h
     and hellomsg is said to be on line 1 in hello.h:
     readelf -wi hello | grep -C3 hellomsg
          DW_AT_byte_size   : 4
          DW_AT_type        : <245>
      <1><29b>: Abbrev Number: 8 (DW_TAG_variable)
          DW_AT_name        : (indirect string, offset: 0xd1): hellomsg
          DW_AT_decl_file   : 2
          DW_AT_decl_line   : 1
          DW_AT_type        : <252>


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