This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Add -var-info-path-expression command
On Tue, Apr 04, 2006 at 05:44:36PM +0400, Vladimir Prus wrote:
> On Tuesday 04 April 2006 17:26, Daniel Jacobowitz wrote:
> > On Tue, Apr 04, 2006 at 11:22:02AM +0400, Vladimir Prus wrote:
> > > Any comments on this yet? I believe we've discussed the rationale for
> > > -var-info-path-expression command in the main list, and agreed that it's
> > > necessary.
> >
> > Yes, I think we've agreed on that.
> >
> > It would be nice if there were test cases and documentation to go with
> > this.
>
> Is this a hard requirement?
To merge the patch? Yes, I think so.
It also has a lot of formatting issues, at least one APPLE LOCAL
marker, and bunch of untranslated error messages (which might be
inappropriate uses of error; some of them maybe should be internal
errors instead; I didn't check yet).
> > I've been putting off looking at this patch, because (A) I had a whole
> > lot of other patches to review, and (B) it's huge and gnarly. I am not
> > really sure that Apple took the right approach with C++ classes and
> > run-time type information. Maybe they did, but it's not at all
> > obvious.
>
> FWIW, I'm not 100% understand what they did, but this does not matter. My
> patch does some surgery to grab only -var-info-path-expression, and no
> type/RTTI related changes.
+ /* This is the most specific type of a C++ class object - as obtained from
+ value_rtti_type. It will be set in two cases:
+
+ a) If the varobj is a pointer or reference to a C++ object. In this
+ case the dynamic_type will be a pointer or reference to the full
+ class.
+ b) If the varobj is a C++ object. In this case, it will be the type
+ of the full object, and the value field will be adjusted by
+ value_full_object to the full object. */
+ struct type *dynamic_type;
+
And the related code below.
I'm not saying it's right or wrong, by the way. I'm saying it's
complicated and I need to spend a while thinking about it.
--
Daniel Jacobowitz
CodeSourcery