This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v4] Make chained function calls in expressions work
- From: Doug Evans <dje at google dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: Siva Chandra <sivachandra at google dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 12 Nov 2014 08:08:54 -0800
- Subject: Re: [PATCH v4] Make chained function calls in expressions work
- Authentication-results: sourceware.org; auth=none
- References: <CAGyQ6gw_eN_zCV2hAC9onA-r8tFi36RN-L1abHfn334zD4q4Zw at mail dot gmail dot com> <201411111521 dot sABFLAQ5008463 at d03av02 dot boulder dot ibm dot com>
On Tue, Nov 11, 2014 at 7:21 AM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> [...]
> The most cleanly "correct" solution would probably be to cache the temporaries
> on the *dummy frame*, because that is the frame associated with all the
> GDB-generated content on the stack, and the dummy_frame struct does persist
> a bit longer than the frame struct. However, getting there would still be
> a bit more difficult, since we'd first have to arrange for a dummy frame to
> persist over multiple inferior call invocations. Currently, the dummy frame
> is automatically popped in infrun as soon as the call returns.
Hi.
OOC, Could one do a quick pass over the parsed expression to first see
if there are any function calls, and if so wrap the entire expression
evaluation in a routine that manages the creation/cleanup of an
"outer" dummy frame?
One catch is that if all calls end up being xmethod calls then we
won't need the dummy frame.
I'm not sure if there'd be any real harm in setting one up though.