Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: David Carlton <carlton@math.stanford.edu>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb <gdb@sources.redhat.com>
Cc: carlton@math.stanford.edu
Subject: Re: adding namespace support to GDB
Date: Fri, 23 Aug 2002 12:20:00 -0000	[thread overview]
Message-ID: <ro1lm6xjs9y.fsf@jackfruit.Stanford.EDU> (raw)
In-Reply-To: <20020823184746.GA25528@nevyn.them.org>

In article <20020823184746.GA25528@nevyn.them.org>, Daniel Jacobowitz
<drow@mvista.com> writes:
> On Fri, Aug 23, 2002 at 11:41:06AM -0700, David Carlton wrote:

>> Certainly it seems like a solution for C++ will initially have to
>> get recreate namespace info from DW_AT_MIPS_linkage_name, and
>> there's no way that we'll be able to allow users to use symbol
>> names as if all the appropriate using directives were in effect,
>> since that information simply isn't in the debug information that
>> GCC is currently producing.

> C++ certainly does _not_ need to reconstruct from
> DW_AT_MIPS_linkage_name.  Everything we need should be there in
> DW_TAG_namespace and DW_TAG_structure/class markers; I have patches
> to use this information, with the caveats I noted in my other
> message.

Sure, if the file being debugged is appropriately tagged with
DW_TAG_namespace.  (And, of course, with DW_TAG_structure/class_type,
and other compound data structures; currently, GCC generates
DW_TAG_structure_type instead of DW_TAG_class_type, but I don't think
that should have much of a practical effect on GDB.)

But we can't refuse to debug C++ code that was produced by a version
of GCC that doesn't generate those tags.  And, right now, the only way
we can get an approximation to namespace information is by looking at
the contents of DW_AT_MIPS_linkage_name.  There are still flaws with
that other than not seeing using directives - e.g. I don't think
there's any way to tell what namespace an enum lives in from the
information that GCC currently produces - but it's a start.

> I am gradually working on removing all uses of the physname from the
> C++ debugging code.  It's a hack (and a space waste!).

Right.  I'm not suggesting that we keep the physnames around
indefinitely.  There's information in DW_AT_MIPS_linkage_name that I
think we need currently, but that doesn't mean that we can't discard
it after using it.  E.g. it makes sense to me that, if GDB runs into a
class declaration, it would grab the DW_AT_MIPS_linkage_name of its
first member, demangle it and figure out where in the namespace
hierarchy the class under investigation lives, and then keep that
information around; once it's done that, it doesn't need to use the
DW_AT_MIPS_linkage_name of any of the other members, let alone keep
them around indefinitely.

David Carlton
carlton@math.stanford.edu


  parent reply	other threads:[~2002-08-23 19:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-23  8:42 David Carlton
2002-08-23 10:46 ` Petr Sorfa
2002-08-23 11:41   ` David Carlton
2002-08-23 11:42     ` Daniel Berlin
2002-08-23 12:26       ` Petr Sorfa
2002-08-23 15:35         ` Daniel Berlin
2002-08-26 16:20           ` Petr Sorfa
2002-08-26 17:32             ` Daniel Berlin
2002-08-27 14:04               ` Petr Sorfa
2002-08-23 11:47     ` Daniel Jacobowitz
2002-08-23 11:48       ` Daniel Berlin
2002-08-23 12:20         ` Daniel Jacobowitz
2002-08-23 12:24           ` David Carlton
2002-08-23 15:32           ` Daniel Berlin
2002-08-23 15:37           ` Jason Molenda
2002-08-23 12:20       ` David Carlton [this message]
2002-08-23 11:05 ` Daniel Jacobowitz
2002-08-23 14:26   ` Daniel Jacobowitz
2002-08-23 17:19 ` David Carlton
2002-08-26  9:56 David Anderson

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=ro1lm6xjs9y.fsf@jackfruit.Stanford.EDU \
    --to=carlton@math.stanford.edu \
    --cc=drow@mvista.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