Re: [PATCH v4] Make chained function calls in expressions work

Siva Chandra
2014-11-13T03:00:48Z

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.