This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Synchronize frame prev_register behavior
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Tue, 9 Jan 2007 15:20:44 -0500
- Subject: [commit] Synchronize frame prev_register behavior
Fixes a FIXME I checked in last year, by making every prev_register
implementation consistently set *lvalp to lval_register if it
recurses to the next frame. Proofread, compiled for alpha-linux,
and checked in.
--
Daniel Jacobowitz
CodeSourcery
2007-01-09 Daniel Jacobowitz <dan@codesourcery.com>
* alpha-mdebug-tdep.c (alpha_mdebug_frame_prev_register): Use
frame_unwind_register to recurse.
* alpha-tdep.c (alpha_sigtramp_frame_prev_register): Likewise.
(alpha_heuristic_frame_prev_register): Likewise.
* h8300-tdep.c (h8300_frame_prev_register): Likewise.
* m32c-tdep.c (m32c_prev_register): Likewise.
* frame.c (frame_register_unwind_location): Remove FIXME.
Index: alpha-mdebug-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-mdebug-tdep.c,v
retrieving revision 1.12
diff -u -p -r1.12 alpha-mdebug-tdep.c
--- alpha-mdebug-tdep.c 9 Jan 2007 17:58:49 -0000 1.12
+++ alpha-mdebug-tdep.c 9 Jan 2007 20:08:13 -0000
@@ -294,8 +294,12 @@ alpha_mdebug_frame_prev_register (struct
}
/* Otherwise assume the next frame has the same register value. */
- frame_register (next_frame, regnum, optimizedp, lvalp, addrp,
- realnump, bufferp);
+ *optimizedp = 0;
+ *lvalp = lval_register;
+ *addrp = 0;
+ *realnump = regnum;
+ if (bufferp)
+ frame_unwind_register (next_frame, *realnump, bufferp);
}
static const struct frame_unwind alpha_mdebug_frame_unwind = {
Index: alpha-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-tdep.c,v
retrieving revision 1.159
diff -u -p -r1.159 alpha-tdep.c
--- alpha-tdep.c 9 Jan 2007 17:58:49 -0000 1.159
+++ alpha-tdep.c 9 Jan 2007 20:08:14 -0000
@@ -864,8 +864,12 @@ alpha_sigtramp_frame_prev_register (stru
current description of it in alpha_sigtramp_frame_unwind_cache
doesn't include it. Too bad. Fall back on whatever's in the
outer frame. */
- frame_register (next_frame, regnum, optimizedp, lvalp, addrp,
- realnump, bufferp);
+ *optimizedp = 0;
+ *lvalp = lval_register;
+ *addrp = 0;
+ *realnump = regnum;
+ if (bufferp)
+ frame_unwind_register (next_frame, *realnump, bufferp);
}
static const struct frame_unwind alpha_sigtramp_frame_unwind = {
@@ -1218,8 +1222,12 @@ alpha_heuristic_frame_prev_register (str
}
/* Otherwise assume the next frame has the same register value. */
- frame_register_unwind (next_frame, regnum, optimizedp, lvalp, addrp,
- realnump, bufferp);
+ *optimizedp = 0;
+ *lvalp = lval_register;
+ *addrp = 0;
+ *realnump = regnum;
+ if (bufferp)
+ frame_unwind_register (next_frame, *realnump, bufferp);
}
static const struct frame_unwind alpha_heuristic_frame_unwind = {
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.217
diff -u -p -r1.217 frame.c
--- frame.c 9 Jan 2007 17:58:50 -0000 1.217
+++ frame.c 9 Jan 2007 20:08:14 -0000
@@ -1103,10 +1103,7 @@ reinit_frame_cache (void)
/* Find where a register is saved (in memory or another register).
The result of frame_register_unwind is just where it is saved
- relative to this particular frame.
-
- FIXME: alpha, m32c, and h8300 actually do the transitive operation
- themselves. */
+ relative to this particular frame. */
static void
frame_register_unwind_location (struct frame_info *this_frame, int regnum,
Index: h8300-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/h8300-tdep.c,v
retrieving revision 1.104
diff -u -p -r1.104 h8300-tdep.c
--- h8300-tdep.c 9 Jan 2007 17:58:51 -0000 1.104
+++ h8300-tdep.c 9 Jan 2007 20:08:14 -0000
@@ -529,8 +529,12 @@ h8300_frame_prev_register (struct frame_
return;
}
- frame_register_unwind (next_frame, regnum,
- optimizedp, lvalp, addrp, realnump, valuep);
+ *optimizedp = 0;
+ *lvalp = lval_register;
+ *addrp = 0;
+ *realnump = regnum;
+ if (valuep)
+ frame_unwind_register (next_frame, *realnump, valuep);
}
static const struct frame_unwind h8300_frame_unwind = {
Index: m32c-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/m32c-tdep.c,v
retrieving revision 1.4
diff -u -p -r1.4 m32c-tdep.c
--- m32c-tdep.c 9 Jan 2007 17:58:51 -0000 1.4
+++ m32c-tdep.c 9 Jan 2007 20:08:14 -0000
@@ -1919,8 +1919,14 @@ m32c_prev_register (struct frame_info *n
/* Otherwise, presume we haven't changed the value of this
register, and get it from the next frame. */
else
- frame_register_unwind (next_frame, regnum,
- optimizedp, lvalp, addrp, realnump, bufferp);
+ {
+ *optimizedp = 0;
+ *lvalp = lval_register;
+ *addrp = 0;
+ *realnump = regnum;
+ if (bufferp)
+ frame_unwind_register (next_frame, *realnump, bufferp);
+ }
}