From: Weimin Pan <weimin.pan@oracle.com>
To: Tom Tromey <tom@tromey.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 23:26:00 -0000 [thread overview]
Message-ID: <8c8e0eb6-245c-40c0-456e-9f49ccb92b74@oracle.com> (raw)
In-Reply-To: <87r2hrt3s6.fsf@tromey.com>
On 9/18/2018 4:59 AM, Tom Tromey wrote:
>>>>>> ">" == 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.
Done.
>>> + PR gdb/16841
> Here too.
Done.
>>> + 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.
Using 6.6 will result in an inexact number as well. Will change it to
"6.25".
> 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.
Sorry, which case is not exercised? Could it be printing superbase class
member in base?
>>> + 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.
There is a brief comment:
                   /* Find class offset of type CURTYPE from either its
                        parent type DOMAIN or the type of implied
this. */
i.e. trying to find the class offset for CURTYPE first from its parent
type DOMAIN.
If failed, try to find it from the type of the implied this.
Thanks for your comments.
Weimin
>
> thanks,
> Tom
next prev parent reply other threads:[~2018-09-18 23:26 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
2018-09-18 23:26 ` Weimin Pan [this message]
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=8c8e0eb6-245c-40c0-456e-9f49ccb92b74@oracle.com \
--to=weimin.pan@oracle.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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