Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Jason Merrill <jason@redhat.com>
Cc: libstdc++@gcc.gnu.org, gdb@sources.redhat.com
Subject: Re: C++ debugging progress
Date: Thu, 22 Nov 2001 00:13:00 -0000	[thread overview]
Message-ID: <20011128163159.A3256@nevyn.them.org> (raw)
In-Reply-To: <wvlbshmy5fb.fsf@prospero.cambridge.redhat.com>

On Wed, Nov 28, 2001 at 09:03:04PM +0000, Jason Merrill wrote:
> >>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:
> 
> > Yep.  Since Base is a virtual base of Left, the DW_AT_data_member_location
> > here should be a complex expression telling the debugger to go through the
> > vtable.  I'll get on it.
> 
> > I'll also change the stabs output to give the offset within the vtable
> > rather than the offset of the base in a complete object; gdb will still
> > need to be clever enough to know what to do with it.
> 
> Please give this a spin; gdb doesn't like it, but I think it's correct.
> Note that the offset given in the stabs output should be treated as
> negative, so for V3 objects,
> 
>   BaseAddr = LeftAddr + *((*LeftAddr) - Offset)
> 
> The dwarf2 output is the above encoded in reverse Polish notation.  I
> suppose we could rely on gdb to know the equation for dwarf, too, but that
> would be nonconforming and only saves four bytes.
> 
> 2001-11-28  Jason Merrill  <jason@redhat.com>
> 
> 	* dwarf2out.c (add_data_member_location_attribute): Do the
> 	right thing for virtual bases.
> 	* dbxout.c (dbxout_type): For a virtual base, print the offset
> 	within the vtable.

I haven't looked at the Dwarf parts - I need to get my current stabs
project sorted out first - but with the removed minus sign, this
simplifies my stabs code tremendously and works just fine.  Any chance
of getting this into 3.0.3 also, or should I just maintain a local
patch?

As for the Dwarf bits, what I'll probably do for now is recognize this
specific form of expression and just stash the negative offset, so that
only the debug readers need to know how I got it.  That will be a bit
of a hack, but I've done worse, and conforming has some uses :)

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


WARNING: multiple messages have this Message-ID
From: Daniel Jacobowitz <drow@mvista.com>
To: Jason Merrill <jason@redhat.com>
Cc: libstdc++@gcc.gnu.org, gdb@sources.redhat.com
Subject: Re: C++ debugging progress
Date: Wed, 28 Nov 2001 13:31:00 -0000	[thread overview]
Message-ID: <20011128163159.A3256@nevyn.them.org> (raw)
Message-ID: <20011128133100.9CxOy5Wpj6XnlMYlhFjTZyOCh4EMSlu05jJpooI9LEw@z> (raw)
In-Reply-To: <wvlbshmy5fb.fsf@prospero.cambridge.redhat.com>

On Wed, Nov 28, 2001 at 09:03:04PM +0000, Jason Merrill wrote:
> >>>>> "Jason" == Jason Merrill <jason@redhat.com> writes:
> 
> > Yep.  Since Base is a virtual base of Left, the DW_AT_data_member_location
> > here should be a complex expression telling the debugger to go through the
> > vtable.  I'll get on it.
> 
> > I'll also change the stabs output to give the offset within the vtable
> > rather than the offset of the base in a complete object; gdb will still
> > need to be clever enough to know what to do with it.
> 
> Please give this a spin; gdb doesn't like it, but I think it's correct.
> Note that the offset given in the stabs output should be treated as
> negative, so for V3 objects,
> 
>   BaseAddr = LeftAddr + *((*LeftAddr) - Offset)
> 
> The dwarf2 output is the above encoded in reverse Polish notation.  I
> suppose we could rely on gdb to know the equation for dwarf, too, but that
> would be nonconforming and only saves four bytes.
> 
> 2001-11-28  Jason Merrill  <jason@redhat.com>
> 
> 	* dwarf2out.c (add_data_member_location_attribute): Do the
> 	right thing for virtual bases.
> 	* dbxout.c (dbxout_type): For a virtual base, print the offset
> 	within the vtable.

I haven't looked at the Dwarf parts - I need to get my current stabs
project sorted out first - but with the removed minus sign, this
simplifies my stabs code tremendously and works just fine.  Any chance
of getting this into 3.0.3 also, or should I just maintain a local
patch?

As for the Dwarf bits, what I'll probably do for now is recognize this
specific form of expression and just stash the negative offset, so that
only the debug readers need to know how I got it.  That will be a bit
of a hack, but I've done worse, and conforming has some uses :)

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2001-11-28 21:31 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-27 23:03 Daniel Jacobowitz
2001-11-18 21:43 ` Daniel Jacobowitz
2001-11-19  9:04 ` Benjamin Kosnik
2001-11-27 23:36   ` Benjamin Kosnik
2001-11-19 11:16 ` Daniel Berlin
2001-11-21 13:37   ` Dan Mosedale
2001-11-28 12:25     ` Dan Mosedale
2001-11-27 23:43   ` Daniel Berlin
2001-11-19 13:41 ` Jason Merrill
2001-11-28  1:31   ` Jason Merrill
2001-11-28  9:41   ` Daniel Jacobowitz
2001-11-21  4:12     ` Daniel Jacobowitz
2001-11-21  5:06     ` Daniel Berlin
2001-11-28 10:36       ` Daniel Berlin
2001-11-28 10:49       ` Daniel Jacobowitz
2001-11-21 12:33         ` Daniel Jacobowitz
2001-11-28 11:41     ` Jason Merrill
2001-11-21 13:21       ` Jason Merrill
2001-11-21 13:42       ` Daniel Jacobowitz
2001-11-28 12:32         ` Daniel Jacobowitz
2001-11-21 16:38       ` Jason Merrill
2001-11-22  0:13         ` Daniel Jacobowitz [this message]
2001-11-24 22:52           ` Jason Merrill
2001-11-29  9:44             ` Jason Merrill
2001-11-29 12:28             ` Daniel Jacobowitz
2001-11-25  8:34               ` Daniel Jacobowitz
2001-11-25  9:01               ` Kevin Buettner
2001-11-25 10:30                 ` Jason Merrill
2001-11-29 19:12                   ` Jason Merrill
2001-11-29 13:11                 ` Kevin Buettner
2001-11-29 12:50               ` Benjamin Kosnik
2001-11-25  8:40                 ` Benjamin Kosnik
2001-11-28 13:31           ` Daniel Jacobowitz
2001-11-28 13:03         ` Jason Merrill
     [not found]       ` <20011128151819.A31514@nevyn.them.org>
2001-11-21 22:26         ` Jason Merrill
2001-11-28 13:14           ` Jason Merrill

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=20011128163159.A3256@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb@sources.redhat.com \
    --cc=jason@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /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