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: [RFA] Fix c++/14819 (implicit this)


>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> +	      /* Try to evaluate NAME as a qualified name with implicit
Keith> +		 this pointer.  In this case, attempt to return the
Keith> +		 equivalent to `this->*(&TYPE::NAME)'.  */

Nice approach, I totally didn't think of it.

I think it would be good to have a test case involving a virtual base
class, preferably one where the virtual base ends up in two different
places in different classes (and then test both cases).

Keith> +		  tmp = lookup_pointer_type (TYPE_TARGET_TYPE (type));
Keith> +		  result = value_from_pointer (tmp,
Keith> +					       value_as_long (v) + mem_offset);
Keith> +		  return value_ind (result);

Here I suspect it would be better to avoid the value_ind for some values
of "noside".  Otherwise I think we could end up reading memory
needlessly (by trying to compute the correct enclosing type).

Tom


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