From: Andrew Cagney <ac131313@cygnus.com>
To: Ben Harris <bjh21@netbsd.org>
Cc: gdb@sources.redhat.com
Subject: Re: PC and PSR on 26-bit ARM
Date: Thu, 25 Oct 2001 21:48:00 -0000 [thread overview]
Message-ID: <3BD8EAF2.3020702@cygnus.com> (raw)
In-Reply-To: <Pine.SOL.4.33.0110230101130.17545-100000@virgo.cus.cam.ac.uk>
> I'm trying to make GDB work happily on NetBSD/arm26, which runs on ancient
> ARM processors, where the PC and PSR share R15. As far as I can tell, the
> code in arm-linux-nat.c, when fetching registers subprocess on a 26-bit
> CPU, puts the PC in registers[PC_REGNUM], and the PC+PSR in
> registers[PS_REGNUM]. When putting registers back into the process, it
> sets R15 (PC+PSR) from registers[PC_REGNUM] and ignores
> registers[PS_REGNUM].
>
> I suppose my question is: is this the intended behaviour? i.e. should I:
> (1) do the same on NetBSD,
> (2) accurately emulate a 32-bit CPU in 26-bit mode (splitting and
> merging PC and PSR at the subprocess interface), or
> (3) present GDB with the real state of the CPU?
>
> I think my preference is for (2), since this saves complexity in the rest
> of GDB.
GDB doesn't really care what happens. It has mechanisms (if only Arm
was multi-arched) to handle cases such as 2.
Do arm26 and arm32 run the same binaries? If they do then you probably
want a consistent interface with carefully documented semantics.
Otherwise, the best rule I know of is ``don't lie'' - present GDB with
the real raw CPU state.
Andrew
next prev parent reply other threads:[~2001-10-25 21:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-10-22 17:27 Ben Harris
2001-10-23 1:35 ` Philip Blundell
2001-10-25 21:48 ` Andrew Cagney [this message]
2001-10-29 14:44 ` Ben Harris
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=3BD8EAF2.3020702@cygnus.com \
--to=ac131313@cygnus.com \
--cc=bjh21@netbsd.org \
--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