From: Daniel Jacobowitz <drow@false.org>
To: jagorak <jagorak@wp.pl>
Cc: Joel Brobecker <brobecker@adacore.com>, gdb@sourceware.org
Subject: Re: Calling an Ada subprogram with complex parameters
Date: Mon, 19 Mar 2007 20:17:00 -0000 [thread overview]
Message-ID: <20070319201712.GA19091@caradoc.them.org> (raw)
In-Reply-To: <1905422578.20070319200802@wp.pl>
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.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2007-03-19 20:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-17 23:11 jagorak
2007-03-18 17:10 ` jagorak
2007-03-19 16:35 ` Joel Brobecker
2007-03-19 18:46 ` Re[2]: " jagorak
2007-03-19 2:16 ` Daniel Jacobowitz
2007-03-19 20:08 ` Re[2]: " jagorak
2007-03-19 20:17 ` Daniel Jacobowitz [this message]
2007-03-19 20:40 ` jagorak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070319201712.GA19091@caradoc.them.org \
--to=drow@false.org \
--cc=brobecker@adacore.com \
--cc=gdb@sourceware.org \
--cc=jagorak@wp.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox