* [patch] Set register even when no frame exists
@ 2008-09-26 17:52 Aleksandar Ristovski
2008-09-26 19:09 ` Daniel Jacobowitz
0 siblings, 1 reply; 2+ messages in thread
From: Aleksandar Ristovski @ 2008-09-26 17:52 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1268 bytes --]
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.
[-- Attachment #2: valops.c-20080926.diff --]
[-- Type: text/x-patch, Size: 764 bytes --]
Index: gdb/valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.200
diff -u -p -r1.200 valops.c
--- gdb/valops.c 11 Sep 2008 14:27:34 -0000 1.200
+++ gdb/valops.c 26 Sep 2008 17:32:56 -0000
@@ -839,6 +839,12 @@ value_assign (struct value *toval, struc
/* Figure out which frame this is in currently. */
frame = frame_find_by_id (VALUE_FRAME_ID (toval));
value_reg = VALUE_REGNUM (toval);
+
+ /* Get sentinel frame. For remote targets that just
+ booted, there will be no frame to work with. Use registers
+ instead (sentinel frame). */
+ if (!frame)
+ frame = get_current_frame ();
if (!frame)
error (_("Value being assigned to is no longer active."));
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [patch] Set register even when no frame exists
2008-09-26 17:52 [patch] Set register even when no frame exists Aleksandar Ristovski
@ 2008-09-26 19:09 ` Daniel Jacobowitz
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2008-09-26 19:09 UTC (permalink / raw)
To: Aleksandar Ristovski; +Cc: gdb-patches
On Fri, Sep 26, 2008 at 01:51:47PM -0400, Aleksandar Ristovski wrote:
> 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.
This doesn't relate to the current frame. The problem is that we
actually identify some frames using null_frame_id, but also overload
it to mean "there is no frame".
I posted a workaround patch last time this came up though I can't find
it right now. There's also a description of the general problem at
http://sourceware.org/ml/gdb/2006-05/msg00109.html.
I wanted to come back to it but I'm currently still stuck on the
inlining patches; only one frame unwinder change at a time for me.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-26 19:09 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-26 17:52 [patch] Set register even when no frame exists Aleksandar Ristovski
2008-09-26 19:09 ` Daniel Jacobowitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox