This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 0/2] Make chained function calls in expressions work
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: sivachandra at google dot com (Siva Chandra)
- Cc: gdb-patches at sourceware dot org (gdb-patches)
- Date: Thu, 23 Oct 2014 18:09:35 +0200 (CEST)
- Subject: Re: [PATCH 0/2] Make chained function calls in expressions work
- Authentication-results: sourceware.org; auth=none
Siva Chandra wrote:
> Restricting to just those values whose address is returned in a hidden
> param (per ABI) is OK, but an implementation detail made me to include
> all types of return values. There are two times when a return value's
> address is required:
>
> 1. When a method is invoked on the return value: GDB has to evaluate
> the 'this' pointer. This is done in eval.c.
Ah, I knew there was something else I was missing :-)
In this case, I agree with the rest of your explanation. Please add a
comment in the final version of the patch that explains why the extra
copy is necessary.
There's just one minor change I think would be good: can we allocate that
extra copy on the stack at least only for *class* types, then? I'd prefer
to avoid this for the common case of routines just returning a scalar.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com