aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-11-27 17:55:38 +0000
committerPedro Alves <palves@redhat.com>2013-11-27 17:55:38 +0000
commit908fa2aaede2b3d1c33d167116101c2152e30616 (patch)
treeb5a58cf7aae9fde316f1a4276d1ea962a3dd3ef0
parent6bd273ae450b2ba626b0f7dbda10947e69578e1d (diff)
downloadgdb-908fa2aaede2b3d1c33d167116101c2152e30616.zip
gdb-908fa2aaede2b3d1c33d167116101c2152e30616.tar.gz
gdb-908fa2aaede2b3d1c33d167116101c2152e30616.tar.bz2
Fix type of not saved registers.
value_of_register_lazy uses the type of REGNUM in FRAME, but given multi-arch, the arch of FRAME might be different from the previous frame's arch, and therefore the type of register REGNUM should be retrieved from the unwound arch. This used to be correct before the previous change. Tested on x86_64 Fedora 17. gdb/ 2013-11-27 Pedro Alves <palves@redhat.com> * frame-unwind.c (frame_unwind_got_optimized): Use the type of the register in the previous frame's arch.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/frame-unwind.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a2da98f..00369e9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2013-11-27 Pedro Alves <palves@redhat.com>
+ * frame-unwind.c (frame_unwind_got_optimized): Use the type of the
+ register in the previous frame's arch.
+
+2013-11-27 Pedro Alves <palves@redhat.com>
+
* frame-unwind.c (frame_unwind_got_optimized): Return
an lval_register value instead of a not_lval value.
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index 68879f3..a731b33 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -161,11 +161,18 @@ default_frame_unwind_stop_reason (struct frame_info *this_frame,
struct value *
frame_unwind_got_optimized (struct frame_info *frame, int regnum)
{
+ struct gdbarch *gdbarch = frame_unwind_arch (frame);
+ struct type *type = register_type (gdbarch, regnum);
struct value *val;
- val = value_of_register_lazy (frame, regnum);
+ /* Return an lval_register value, so that we print it as
+ "<not saved>". */
+ val = allocate_value_lazy (type);
set_value_lazy (val, 0);
set_value_optimized_out (val, 1);
+ VALUE_LVAL (val) = lval_register;
+ VALUE_REGNUM (val) = regnum;
+ VALUE_FRAME_ID (val) = get_frame_id (frame);
return val;
}