From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Ben Harris Cc: gdb@sources.redhat.com Subject: Re: PC and PSR on 26-bit ARM Date: Thu, 25 Oct 2001 21:48:00 -0000 Message-id: <3BD8EAF2.3020702@cygnus.com> References: X-SW-Source: 2001-10/msg00241.html > 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