This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: PC and PSR on 26-bit ARM
>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 don't think the 26-bit support for arm-linux has ever really been tested, so
you probably don't want to put too much faith in it. What you've described
doesn't really sound like the right thing to me; the fetching side is OK, but
when it writes registers back into the process I think it needs to combine
registers[PC_REGNUM] and registers[PS_REGNUM] in order to get the correct R15
value.
p.