This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH PR gdb/16841] virtual inheritance via typedef cannot find base


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]