aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame-unwind.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-07-04 18:10:04 +0000
committerPedro Alves <palves@redhat.com>2013-07-04 18:10:04 +0000
commit7195e6f018c7928c8b7be37e56b4df2656402618 (patch)
treeb36ae6e79a2341a4e324110fe8b46527be55361e /gdb/frame-unwind.c
parent58722cac5aa9ea0b18a8fe5e76031f62cea017bc (diff)
downloadgdb-7195e6f018c7928c8b7be37e56b4df2656402618.zip
gdb-7195e6f018c7928c8b7be37e56b4df2656402618.tar.gz
gdb-7195e6f018c7928c8b7be37e56b4df2656402618.tar.bz2
Use allocate_optimized_out_value instead of set_value_optimized_out.
Allocate the value as optimized out from the start rather than allocating a value with contents, and then marking it optimized out. gdb/ 2013-07-04 Pedro Alves <palves@redhat.com> * findvar.c (value_of_register): Use allocate_optimized_out_value if the register has been optimized out, instead of set_value_optimized_out. * frame-unwind.c (frame_unwind_got_optimized): Use allocate_optimized_out_value.
Diffstat (limited to 'gdb/frame-unwind.c')
-rw-r--r--gdb/frame-unwind.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index b66febf..ce2f6da 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -162,11 +162,9 @@ struct value *
frame_unwind_got_optimized (struct frame_info *frame, int regnum)
{
struct gdbarch *gdbarch = frame_unwind_arch (frame);
- struct value *reg_val;
+ struct type *reg_type = register_type (gdbarch, regnum);
- reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
- set_value_optimized_out (reg_val, 1);
- return reg_val;
+ return allocate_optimized_out_value (reg_type);
}
/* Return a value which indicates that FRAME copied REGNUM into