This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Modifying a verboten register
On Thu, May 04, 2006 at 08:45:44AM -0600, Shaun Jackman wrote:
> Targetted for arm-elf, gdb does not let me modify the cpsr register
> outside of a "normal" frame.
>
> (gdb) p/x $cpsr=0x3f
> Value being assigned to is no longer active.
I posted an explanation of this problem on gdb-patches yesterday, as it
happens, with a nasty hack.
> Parties aside, the JTAG interface I use (BDI2000) has a command mode
> (Telnet interface) that I can use to modify the register. GDB seems to
> cache its view of the registers though.
Correct.
> (gdb) p/x $cpsr
> $1 = 0xd7
>
> [in a galaxy far, far away]
> BDI>rm cpsr 0x3f
> BDI>rd cpsr
> cpsr: 0x0000003f 63
Right here, use the flushregs command in GDB.
> (gdb) p/x $cpsr
> $2 = 0xd7
--
Daniel Jacobowitz
CodeSourcery