[patch] Set register even when no frame exists

Aleksandar Ristovski aristovski@qnx.com
Fri Sep 26 17:52:00 GMT 2008


Hello,


We have recently run into a problem with an ARM board debugging via a jtag emulator (bdi2000). The problem looks very much like what was discussed in "GDB and ARM Frame Pointer strangeness" (http://sources.redhat.com/ml/gdb/2004-06/msg00040.html)

What is happening in our case is this: 

gdb connects to bdi2000 (target remote ...) then reset command is issued via bdi2000 (monitor reset...) the target is reset. (and stopped). bdi2000 via init sequence initializes on-board hardware.

After that, gdb loads image into device memory. 

However, when gdb now tries to set PC to the start instruction of the loaded image, GDB fails with:

"Value being assigned to is no longer active"

and gives up trying to write the register.


Note that at this point the target is barely initialized; stack pointer register (GPR 11) has random value which makes frame_find_by_id to fail.

Simple solution (see the patch attached) is to call "get_current_frame" which will effectively create a sentinel frame.To me having only sentinel frame at this point in game makes a lot of sense.


Thanks,

Aleksandar Ristovski
QNX Software Systems



2008-09-26  Aleksandar Ristovski  <aristovski@qnx.com>

	* valops.c (value_assign): Get current frame if frame_find_by_id
	fails.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: valops.c-20080926.diff
Type: text/x-patch
Size: 764 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080926/5a056f9f/attachment.bin>


More information about the Gdb-patches mailing list