[RFC] Struct return values

Andrew Cagney cagney@gnu.org
Sun Jan 18 16:31:00 GMT 2004


>    Date: Sat, 17 Jan 2004 14:08:45 -0500
>    From: Andrew Cagney <cagney@gnu.org>
> 
>    Mark, BTW,
> 
>    How does:
> 	   extract_returned_value_address (arch, type, caller_frame)
>    look for a function name?
> 
> Seems fine to me.  I'll have a go at implementing this after I've
> flushed some of my pending changes.  A target should only define this
> method if it has a realiable way, at every point in a called function,
> to fetch the address, isn't it?

When looking at the code I found two cases:

"return VALUE":
GDB first pops the callers frame, and second stores the return VALUE. 
This means that the method will see caller's frame just after the callee 
has been forceably "returned".

"finish"
GDB first finishes the function, and second extracts the return VALUE. 
This again means that the method will see the caller's frame just after 
the callee has returned.

So perhaphs something like:
The target should only define this method if it has a reliable way of 
extracting the struct-convention return-value address using only 
information obtained from the caller's frame just after the callee has 
returned.  [insert something about how this is impossible on most ABIs :-)]

Andrew





More information about the Gdb mailing list