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: Siva Chandra <sivachandra at google dot com>
- To: Doug Evans <dje at google dot com>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>, gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 12 Nov 2014 19:00:44 -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> <CADPb22S1XgTw060B2C18-DvqAxmuQ3L2QFPWRpygPitSyVKKHg at mail dot gmail dot com>
On Wed, Nov 12, 2014 at 8:08 AM, Doug Evans <dje@google.com> wrote:
> 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?
If I understand you correctly, isn't the general direction of the
proposed solution already this? It differs in the fact that the
"outer" frame is adjusted as required by the expression instead of
"fixing" it before the evaluation of the expression. The notion of an
"outer" frame is not explicitly present though.