This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: -var-info-path-expression
- From: Daniel Jacobowitz <drow at false dot org>
- To: Vladimir Prus <ghost at cs dot msu dot su>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 3 Jan 2007 17:39:20 -0500
- Subject: Re: -var-info-path-expression
- References: <200612251200.42622.ghost@cs.msu.su>
On Mon, Dec 25, 2006 at 12:00:42PM +0300, Vladimir Prus wrote:
>
> This patch implements new MI command, -var-info-path-expression,
> that, given a variable object, returns full expression that corresponds
> to it. Both KDevelop and Eclipse have now code that guesses such
> full expression, and that code is rather hacky, and not exactly correct.
>
> Moreover, as soon as MI is taught to get the true type
> polymorphic C++ objects and display fields of the real type, such full expression
> cannot be computed in frontend at all.
>
> The essence of this patch -- which expressions are returned in which cases -- are
> ported without change from the Apple branch. The code structure is much
> different though -- this patch capitalizes on MI refactoring patches I've posted
> recently.
>
> This is lightly tested by hand, I'll write automated tests later. There's no docs
> either -- again, will be written after discussion.
>
> There is a couple of issues with this patch:
>
> - I don't much like 'var-info-path-expression' name, but
> naming of MI commands is not very important.
True - I think it's fine.
> - I'm not sure why we can't report full expression in the
> output of -var-list-children. The code I have does not seem
> very computationally expensive.
Also true. If this would be more useful, I'd be happy to do it that
way - would you still need -var-info-path-expression?
Having digested the patch, it looks generally OK. I didn't really
proofread it; I'll save that until there's some docs and tests, and
the earlier patches are in. Sorry, too much at once for me.
--
Daniel Jacobowitz
CodeSourcery