> * Figure out the value returned by the function. */
> /* elz: I defined this new macro for the hppa architecture only.
> this gives us a way to get the value returned by the function from the stack,
> at the same address we told the function to put it.
> We cannot assume on the pa that r28 still contains the address of the returned
> structure. Usually this will be overwritten by the callee.
> I don't know about other architectures, so I defined this macro
> */
>
> #ifdef VALUE_RETURNED_FROM_STACK
> if (struct_return)
> {
> do_cleanups (retbuf_cleanup);
> return VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
> }
> #endif
With the corresponding code lifted from HP/UX.
Andrew, this approach has the same short-coming as the approach
that you rejected when I tried to use it last week. It has no
stack. It will not handle nested target function calls, because
this part of gdb is not recursive. The patch that I am submitting
here does not have that problem -- it keeps nested return addresses
in a stack.
The obvious short-comming in the original patch was its relance on a
global variable hack. I didn't even consider it beyond that.