This is the mail archive of the
mailing list for the GDB project.
Re: [RFA] Fix c++/14819 (implicit this)
- From: Tom Tromey <tromey at redhat dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: "gdb-patches\ at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Wed, 06 Nov 2013 10:42:56 -0700
- Subject: Re: [RFA] Fix c++/14819 (implicit this)
- Authentication-results: sourceware.org; auth=none
- References: <52795E6A dot 2050506 at redhat dot com>
>>>>> "Keith" == Keith Seitz <firstname.lastname@example.org> 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).