public inbox for gdb-patches@sourceware.org
 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 PR gdb/16841] virtual inheritance via typedef cannot find base
Date: Sun, 29 Jul 2018 02:28:00 -0000	[thread overview]
Message-ID: <87y3duojwj.fsf@tromey.com> (raw)
In-Reply-To: <1532128565-75923-1-git-send-email-weimin.pan@oracle.com> (Weimin	Pan's message of "Fri, 20 Jul 2018 18:16:05 -0500")

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.

Weimin> +		  for (index = 0; index < TYPE_NFIELDS (domain); index++) 

I think the loop limit should be TYPE_N_BASECLASSES.
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.

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).

Weimin> +		  else 
Weimin> +		      mem_offset = value_as_long (ptr);

This line is indented too far.

thanks,
Tom

  parent reply	other threads:[~2018-07-29  2:28 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 [this message]
2018-07-30 17:58   ` Wei-min Pan
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=87y3duojwj.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).