From: Andrew STUBBS <andrew.stubbs@st.com>
To: GDB Patches <gdb-patches@sourceware.org>
Subject: [PATCH] Allow writing to registers before the program starts
Date: Wed, 03 May 2006 14:06:00 -0000 [thread overview]
Message-ID: <4458B803.5050506@st.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 717 bytes --]
Hi,
It used to be possible to write to registers before starting the program
(on a simulator or other target that has registers that early). This is
useful to start a program from a non-standard point, or else, with a
target which retains it state between runs, reset the target to a usable
state.
E.g:
(gdb) target sim
(gdb) load
(gdb) set $pc = 0x100
However, this now results in the message 'Value being assigned to is no
longer active.'.
I have tracked this to a patch here:
http://sourceware.org/ml/gdb-patches/2004-11/msg00317.html
Reverting the valops.c portion of this patch solves the problem for me.
I have tested it and it produced no regressions.
Ok to apply the attached reversion?
Andrew
[-- Attachment #2: register-write.patch --]
[-- Type: text/plain, Size: 954 bytes --]
2006-05-03 Andrew Stubbs <andrew.stubbs@st.com>
* valops.c (value_assign): Revert Andrew Cagney's patch from
2004-11-15: re-allow writing of registers before there is
a current frame.
Index: src/gdb/valops.c
===================================================================
--- src.orig/gdb/valops.c 2006-05-03 14:13:36.000000000 +0100
+++ src/gdb/valops.c 2006-05-03 14:14:28.000000000 +0100
@@ -610,8 +610,16 @@ value_assign (struct value *toval, struc
int value_reg;
/* Figure out which frame this is in currently. */
- frame = frame_find_by_id (VALUE_FRAME_ID (toval));
- value_reg = VALUE_REGNUM (toval);
+ if (VALUE_LVAL (toval) == lval_register)
+ {
+ frame = get_current_frame ();
+ value_reg = VALUE_REGNUM (toval);
+ }
+ else
+ {
+ frame = frame_find_by_id (VALUE_FRAME_ID (toval));
+ value_reg = VALUE_REGNUM (toval);
+ }
if (!frame)
error (_("Value being assigned to is no longer active."));
next reply other threads:[~2006-05-03 14:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-03 14:06 Andrew STUBBS [this message]
2006-05-03 14:40 ` Daniel Jacobowitz
2006-05-04 9:43 ` Andrew STUBBS
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4458B803.5050506@st.com \
--to=andrew.stubbs@st.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox