Bug 91599 - can't see header sources from gdb when compiling with gcc3
Summary: can't see header sources from gdb when compiling with gcc3
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gdb
Version: 9
Hardware: i686
OS: Linux
medium
low
Target Milestone: ---
Assignee: Elena Zannoni
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-05-25 15:48 UTC by Need Real Name
Modified: 2015-01-08 00:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-02 19:03:49 UTC
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2003-05-25 15:48:46 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Description of problem:
If you compile C code that includes header files, some of those header files
don't appear in the source list from gdb.  This behaviour is different from the
gcc that shipped with redhat 7.3 (2.96).

Here is a simple example:

$ cat hello.c
#include <stdio.h>
#include "hello.h"

int main(int argc, char *argv[])
{

  printf("%s", hellomsg);

}
$ cat hello.h
const char *hellomsg = "Hello world!\n";
$ gcc -g -o hello hello.c
$ gdb hello
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
...
(gdb) list hello.h:1
No source file named hello.h.
(gdb) info sources
Source files for which symbols have been read in:

Source files for which symbols will be read in on demand:

/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/crtn.S,
hello.c, 
/usr/src/build/231499-i386/BUILD/glibc-2.3.2-20030313/build-i386-linux/csu/crti.S,
init.c, ../sysdeps/i386/elf/start.S

Note that gdb can't list hello.h and hello.h doesn't appear in the source list.
 With older versions of gcc (2.96 for example), hello.h would have been listable
and would appear in the info source list.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Compile example code as shown above
2. run gdb with example executable
3. type "info sources"
    

Actual Results:  gdb can't list hello.h and hello.h doesn't appear in source list

Expected Results:  gdb used to be able to list hello.h and hello.h was shown in
the source list

Additional info:

Comment 1 Jakub Jelinek 2003-05-26 10:19:58 UTC
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>

Comment 2 Need Real Name 2005-03-25 17:35:40 UTC
gcc4 has the same problem (or causes gdb to have the same problem if it's a gdb
problem).  I used the version of gcc4 from fc3:
gcc4  --version
gcc4 (GCC) 4.0.0 20041019 (Red Hat 4.0.0-0.8)


Comment 3 Bill Nottingham 2006-08-05 04:37:08 UTC
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.


Comment 5 Bill Nottingham 2007-01-02 19:03:49 UTC
Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
f you are currently still running Red Hat Linux 7.3 or 9, you are strongly
advised to upgrade to a current Fedora Core release or Red Hat Enterprise Linux
or comparable. Some information on which option may be right for you is
available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.


Note You need to log in before you can comment on or make changes to this bug.