Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Weimin Pan <weimin.pan@oracle.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v3 PR gdb/16841] virtual inheritance via typedef cannot find base
Date: Tue, 18 Sep 2018 11:59:00 -0000	[thread overview]
Message-ID: <87r2hrt3s6.fsf@tromey.com> (raw)
In-Reply-To: <1536800471-78975-1-git-send-email-weimin.pan@oracle.com> (Weimin	Pan's message of "Wed, 12 Sep 2018 20:01:11 -0500")

>>>>> ">" == Weimin Pan <weimin.pan@oracle.com> writes:

>> +2018-09-12  Weimin Pan  <weimin.pan@oracle.com>
>> +
>> +	PR gdb/16841

This should read "PR c++/16841".  The robot doesn't care but I suppose
it's a bit clearer for humans.

>> +	PR gdb/16841

Here too.

>> +        gdb_test "print ${scope}d" " = 6.5999999999999996"

It's best with floats to use a number that is exact.
So, instead of 6.6, 6.25 or something like that.

The code has a loop to deal with multiple inheritance but the test
doesn't exercise this case.  I think an additional for that would be
good.

>> +		      if (get_baseclass_offset (domain, curtype, v, &boff,
>> +						&isvirt))
>> +		        mem_offset += boff;
>> +		      else
>> +		        {
>> +		          struct type *t = check_typedef (value_type (this_v));
>> +		          t = check_typedef (TYPE_TARGET_TYPE (t));
>> +		          if (get_baseclass_offset (t, curtype, this_v,
>> +						    &boff, &isvirt))
>> +		            mem_offset += boff;

Could you explain this "else" block?  I did not understand the reason
for it.  I suppose it could use a comment.

thanks,
Tom


  parent reply	other threads:[~2018-09-18 11:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13  1:39 Weimin Pan
2018-09-14 18:26 ` Simon Marchi
2018-09-14 21:49   ` Weimin Pan
2018-09-18 11:59 ` Tom Tromey [this message]
2018-09-18 23:26   ` Weimin Pan
2018-10-04 22:20     ` Tom Tromey
2018-10-04 23:51       ` Wei-min Pan
2018-10-05 14:02         ` Tom Tromey

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=87r2hrt3s6.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=weimin.pan@oracle.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