From: Chris Zankel <zankel@tensilica.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb@sources.redhat.com
Subject: Re: RFC: Available registers as a target property
Date: Tue, 10 May 2005 00:23:00 -0000 [thread overview]
Message-ID: <427FFF0A.8010800@tensilica.com> (raw)
In-Reply-To: <20050509230746.GA20085@nevyn.them.org>
Daniel Jacobowitz wrote:
>>I am wondering if it would also make sense to support the other way
>>around and let GDB tell the target about the processor/register
>>configuration.
> The daemon would already have to be updated to understand any new
> protocol extensions, so we're talking about modifying that agent in any
> case. Given that, can you explain what advantage we would gain by
> having GDB pass configuration information to the daemon, instead of
> having the daemon parse some text file at startup and then communicate
> the configuration information to GDB?
I was thinking about an architecture with multiple configurations
(registers), such as Arc, Tensilica, ARM coprocessors (?), etc.
Having a single daemon supporting these multiple (arbitrary)
configurations would probably be easier for JTAG probe vendors. Since
GDB certainly needs to know about the particular configuration, the
daemon wouldn't need to be modified for each configuration.
> I don't want to support both directions just for kicks, but there may
> be value here that I haven't thought of yet. That's why I asked
> Tensilica for feedback.
I understand. I was just wondering if this would be useful and actully
agree that your proposal makes much more sense and that the target
should know about the configuration.
In our case, the daemon currently doesn't know about a particular
configuration, and GDB only queries for registers the processor (better)
has. For example, to read 'special register' <SR>, OCD simply issues a
rsr a2,<SR> and doesn't know if this <SR> really exists.
>>In our case (Tensilica-Xtensa), we have a non-sequential register
>>encoding and use the pnum <-> regnum mapping. For example, all address
>>registers might have a pnum 0x10XX, special register 0x11XX, etc.
> That would work fine as long as you mapped them to sequential register
> numbers internal to GDB.
>>Sorry, but what do you mean by 'protocol number'? Is that 'pnum' in
>>remote.c?
> A number specific to whatever protocol is being used. For the remote
> protocol that's the index into the g/G packet and the index used with
> p/P packets. So, yes.
Note, however, that in our case, pnum is not the index into the g/G
packet, and hopefully doesn't need to be?
In cases where pnum is not sequential, you would also need a 'reverse'
lookup function to get the register from pnum, something like this:
static struct packet_reg *
packet_reg_from_pnum (struct remote_state *rs, LONGEST pnum)
{
int i;
for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
{
struct packet_reg *r = &rs->regs[i];
if (r->pnum == pnum)
return r;
}
return NULL;
}
Again, this function would only be called if gdbarch provided a
pnum<->regnum mapping function.
~Chris
next prev parent reply other threads:[~2005-05-10 0:23 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
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 [this message]
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=427FFF0A.8010800@tensilica.com \
--to=zankel@tensilica.com \
--cc=drow@mvista.com \
--cc=gdb@sources.redhat.com \
/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