public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Dave Lawrence <dgl@integrinautics.com>
To: gdb@sources.redhat.com
Subject: some header sources not seen from gdb
Date: Thu, 12 Jun 2003 22:14:00 -0000	[thread overview]
Message-ID: <3EE8FB41.61C93BA6@integrinautics.com> (raw)


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>

                 reply	other threads:[~2003-06-12 22:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EE8FB41.61C93BA6@integrinautics.com \
    --to=dgl@integrinautics.com \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).