From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24127 invoked by alias); 12 Jun 2003 22:14:28 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 24119 invoked from network); 12 Jun 2003 22:14:27 -0000 Received: from unknown (HELO smtp.integrinautics.com) (204.247.117.11) by sources.redhat.com with SMTP; 12 Jun 2003 22:14:27 -0000 Received: from integrinautics.com (endor.integrinautics.com [192.168.117.115]) by smtp.integrinautics.com (8.10.2/8.10.2) with ESMTP id h5CMEQN03704 for ; Thu, 12 Jun 2003 15:14:26 -0700 (PDT) Message-ID: <3EE8FB41.61C93BA6@integrinautics.com> Date: Thu, 12 Jun 2003 22:14:00 -0000 From: Dave Lawrence Organization: IntegriNautics Corporation X-Accept-Language: en MIME-Version: 1.0 To: gdb@sources.redhat.com Subject: some header sources not seen from gdb Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00227.txt.bz2 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 #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>