This is the mail archive of the
mailing list for the GDB project.
Re: Calling an Ada subprogram with complex parameters
On Mon, Mar 19, 2007 at 08:08:02PM +0000, jagorak wrote:
> >> where $myRec is a convenience variable of type "Rec", but this
> >> wouldn't work either since convenience variable resides in
> >> gdb-specific memory space, complex types seem to be passed by
> >> reference and myProc cannot access memory address of $myRec.
> DJ> Actually, that's not true - convenience variables which have a
> DJ> memory location are put into the target's memory. Sometimes GDB
> DJ> uses the stack, other times malloc is called under the hood.
> That is very good news to me, as using absolute addressess is much
> less convenient than using convenience variables.
It depends on what you've done with them. As you see below, it's
possible in some cases to have a convenience variable of a compound
type. If you do that, it does not have a memory location.
GDB would need support for pushing the variable into target memory at
the appropriate time (and deciding what "appropriate" meant).
This is made rather tricky, because (A) calling malloc perturbs the
program, so we want to do it as little as possible, but (B) putting a
variable on the stack breaks if the called function saves its address.