From: Daniel Jacobowitz <drow@false.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb@sourceware.org
Subject: Re: RFC: Available registers as a target property
Date: Mon, 09 May 2005 15:37:00 -0000 [thread overview]
Message-ID: <20050509153718.GA20242@nevyn.them.org> (raw)
In-Reply-To: <01c5533c$Blat.v2.4$0259a620@zahav.net.il>
On Sat, May 07, 2005 at 10:35:02PM +0300, Eli Zaretskii wrote:
> > Thinking about it now, the parsing could be pushed down into the remote
> > protocol implementation, and a C structure returned as a binary blob
> > via target_read_partial.
>
> That's what I had in mind, sort of.
>
> > Do you think that would be a better interface to choose?
>
> I think so, but it's an idea based on general principles; I know much
> less than you about the remote targets. So if you find that what I
> suggested has any significant drawbacks, I won't insist.
I've thought about this some more. I see one drawback, but it is
definitely solvable.
The data structure is not readily fixed-size. The target-specific data
has no specified format, so it will be a binary (or probably ASCII)
blob; the common format data will include character strings, e.g. the
names of registers, which will have to be allocated somewhere. We
don't want to leak them, so they need to have a defined lifetime.
The target_read_partial interface is not well suited to that because
the data may be transfered in multiple chunks; each time, we call down
to the target. The best thing I can think of would be to create the
data structure once in the target, store it persistently, and then feed
bits of that data structure back via to_xfer_partial. This requires
mutable data attached to the target object. Nowadays we can use
target_ops:to_data for this, so that should be OK.
This lets the target control the data lifetime. Handy, since it allows
for const structures for simulator targets, where we know the available
features at compile time.
So that should work OK.
--
Daniel Jacobowitz
CodeSourcery, LLC
next prev parent reply other threads:[~2005-05-09 15:37 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-06 16:20 Daniel Jacobowitz
2005-05-07 10:25 ` Eli Zaretskii
2005-05-07 16:19 ` Daniel Jacobowitz
2005-05-07 19:37 ` Eli Zaretskii
2005-05-09 15:37 ` Daniel Jacobowitz [this message]
2005-05-09 20:58 ` Eli Zaretskii
2005-05-07 16:04 ` Mark Kettenis
2005-05-09 16:20 ` Daniel Jacobowitz
2005-05-09 15:57 ` Paul Brook
2005-05-09 16:32 ` Daniel Jacobowitz
2005-05-09 21:33 ` Chris Zankel
2005-05-09 23:07 ` Daniel Jacobowitz
2005-05-10 0:23 ` Chris Zankel
2005-05-10 21:08 ` Daniel Jacobowitz
2005-05-12 23:35 ` Chris Zankel
2005-05-17 14:03 ` Daniel Jacobowitz
2005-05-10 0:54 ` Ramana Radhakrishnan
2005-05-10 21:14 ` Daniel Jacobowitz
2005-05-17 19:32 ` Daniel Jacobowitz
2005-05-18 9:29 ` Richard Earnshaw
2005-05-19 1:00 ` Daniel Jacobowitz
2005-05-20 14:54 ` Richard Earnshaw
2005-05-09 22:39 Paul Schlie
2005-05-10 0:03 Paul Schlie
2005-05-10 11:12 Paul Schlie
2005-05-17 23:08 Paul Schlie
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=20050509153718.GA20242@nevyn.them.org \
--to=drow@false.org \
--cc=eliz@gnu.org \
--cc=gdb@sourceware.org \
/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