Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org
Subject: Re: [PATCH v3] gdb: bfin: new port
Date: Wed, 15 Dec 2010 18:38:00 -0000	[thread overview]
Message-ID: <201012151337.50327.vapier@gentoo.org> (raw)
In-Reply-To: <201012151800.52772.pedro@codesourcery.com>

[-- Attachment #1: Type: Text/Plain, Size: 2602 bytes --]

On Wednesday, December 15, 2010 13:00:27 Pedro Alves wrote:
> On Wednesday 15 December 2010 17:07:11, Mike Frysinger wrote:
> > > It all looks like you should really make the PC and the CC registers
> > > pseudo registers handled by gdb, and not pass them on the remote
> > > protocol wire, getting rid of all the possibility of confusing
> > > out-of-sync iret/pc, astat/cc.
> > 
> > the trouble with PC is that it isnt always RETI.  with a Linux userspace
> > app, the PC is managed indirectly via RETI (by nature of the sequencer).
> >  but this all depends on the level the remote stub is operating at.  it
> > could possibly be indirectly handled by RETX or RETN or RETE as well.
> > so i think the PC
> > logic needs to be left up to the remote stub to properly manage.  i dont
> > think we need to worry about people attempting to screw with any of the
> > supervisor level registers (RET[IXNE]) because they arent allowed to in
> > usermode and they make no sense unless you're in any of those contexts
> > (interrupt/exception/nmi/emulation).
> 
> I see.  Does the correct pc register depend on context (in exception, in
> interrupt, in normal code, in whatnot), or is it always fixed per stub?  If
> the latter, it sounds like something that should be handled by a xml target
> description that somehow tells gdb which register is the pc (sounds more
> complicated than it is, I think).  If the former, is there any way to tell
> which is the correct register by reading some other register, perhaps?
> Otherwise, yeah, best keep it a separate register, which is a bit of a
> shame...

in practice, i think the reg would be fixed per stub, but there isnt a 
requirement for it to be.

in the Linux case, the userspace PC often shuffles between all the registers, 
and eventually shoves it into RETI (due to how the kernel resumes user mode 
from supervisor mode).  userspace doesnt actually know about this ... it 
merely asks via ptrace for the PT_PC register.  changing things in the kernel 
could break this assumption (RETI == PC), but the ABI would be preserved since 
we have the PT_PC indirection.

conceivably, a stub operating in a higher mode could pick it from the right 
register immediately rather than doing the delayed loading seen in the linux 
kernel.

the Blackfin simulator actually does have a dedicated PC register, so in that 
case the request is fulfilled from that source.

having the stub export the indirect logic on the fly might be possible, but 
i'm not sure the extra complication required is an improvement.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2010-12-15 18:38 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09  9:29 [PATCH v2] " Mike Frysinger
2010-12-09  9:31 ` [PATCH v2] gdbserver: " Mike Frysinger
2010-12-13 18:44   ` Pedro Alves
2010-12-13 19:24     ` Mike Frysinger
2010-12-14  9:37     ` Andrew Stubbs
2010-12-14 15:10       ` Mike Frysinger
2010-12-14 16:31         ` Pedro Alves
2010-12-14 16:58           ` Mike Frysinger
2010-12-14 17:16             ` Andrew Stubbs
2010-12-14 17:26               ` Mike Frysinger
2010-12-15 11:54                 ` Andrew Stubbs
2010-12-15 12:55                   ` [toolchain-devel] " Mike Frysinger
2010-12-15 13:17                     ` Andrew Stubbs
2010-12-14 17:40             ` Pedro Alves
2010-12-14 17:48               ` Mike Frysinger
2010-12-14 18:06                 ` Pedro Alves
2010-12-14 18:21                   ` Mike Frysinger
2010-12-15 16:54                     ` Mike Frysinger
2010-12-14  6:03 ` [PATCH v2] gdb: " Joel Brobecker
2010-12-14 16:14   ` Mike Frysinger
2010-12-14 20:43 ` [PATCH v3] " Mike Frysinger
2010-12-14 21:31   ` Pedro Alves
2010-12-14 22:01     ` Mike Frysinger
2010-12-15 13:02       ` Mike Frysinger
2010-12-15 16:53         ` Pedro Alves
2010-12-15 17:08           ` Mike Frysinger
2010-12-15 18:01             ` Pedro Alves
2010-12-15 18:38               ` Mike Frysinger [this message]
2010-12-15 18:42                 ` Pedro Alves
2010-12-15 18:16             ` Mike Frysinger
2010-12-15 18:25               ` Pedro Alves
2010-12-14 21:48   ` [PATCH v3] gdbserver: " Mike Frysinger
2010-12-14 23:03     ` Ralf Corsepius
2010-12-15  0:15       ` Mike Frysinger

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=201012151337.50327.vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=toolchain-devel@blackfin.uclinux.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