From: Wei-min Pan <weimin.pan@oracle.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH PR gdb/16841] virtual inheritance via typedef cannot find base
Date: Mon, 30 Jul 2018 17:58:00 -0000 [thread overview]
Message-ID: <8147f44e-5deb-9f32-76b1-ead651975961@oracle.com> (raw)
In-Reply-To: <87y3duojwj.fsf@tromey.com>
Hi Tom,
Thanks very much for the comments.
On 7/28/2018 7:28 PM, Tom Tromey wrote:
> Thanks for the patch. There are a few small issues with it.
>
> First, git says that most of the lines in the valops.c part have a
> trailing space. Please remove those.
Will do.
> Weimin> + for (index = 0; index < TYPE_NFIELDS (domain); index++)
>
> I think the loop limit should be TYPE_N_BASECLASSES.
OK, will change it to TYPE_N_BASECLASSES. BTW, there are quite a number
of places that use:
   for (i = 0; i < TYPE_NFIELDS (type); ++i)
> And, is it possible for the desired type to be a base class of a base class?
> I suspect so, but I didn't try to check; in this case you will need some
> recursion here, and also I think a new test for this case would be good.
Yes, I think it's possible and will need to do recursions here. Also
will expand the submitted
test with such classes.
>
> Weimin> + if (TYPE_FIELDS (domain)[index].type == curtype)
>
> It is more idiomatic to write TYPE_FIELD_TYPE (domain, index) here.
> Also I think you need check_typedef on the left-hand-side.
> Otherwise perhaps using a typedef for a base class would confuse gdb
> (depending on whether the compiler emits typedefs here or not).
Good point. Will change it to
   if (check_typedef (TYPE_FIELD_TYPE (domain,index)) == curtype)
> Weimin> + else
> Weimin> + mem_offset = value_as_long (ptr);
>
> This line is indented too far.
OK.
Thanks again,
Weimin
>
> thanks,
> Tom
next prev parent reply other threads:[~2018-07-30 17:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-20 23:50 Weimin Pan
2018-07-24 22:18 ` Simon Marchi
2018-07-24 23:26 ` Weimin Pan
2018-07-29 2:28 ` Tom Tromey
2018-07-30 17:58 ` Wei-min Pan [this message]
2018-07-31 15:42 ` Tom Tromey
-- strict thread matches above, loose matches on Subject: below --
2018-06-15 23:45 Weimin Pan
2018-06-17 1:06 ` Simon Marchi
2018-06-18 16:12 ` Wei-min Pan
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=8147f44e-5deb-9f32-76b1-ead651975961@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