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:
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>
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)
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.
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.