This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Make "set debug frame 1" output print <not saved> instead of <optimized out>.
- From: Pedro Alves <palves at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 27 Nov 2013 18:13:50 +0000
- Subject: Re: [PATCH 2/2] Make "set debug frame 1" output print <not saved> instead of <optimized out>.
- Authentication-results: sourceware.org; auth=none
- References: <5208D50F dot 8020109 at broadcom dot com> <1385574760-26557-1-git-send-email-palves at redhat dot com> <1385574760-26557-3-git-send-email-palves at redhat dot com>
On 11/27/2013 05:52 PM, Pedro Alves wrote:
> struct value *
> frame_unwind_got_optimized (struct frame_info *frame, int regnum)
> {
> - struct gdbarch *gdbarch = frame_unwind_arch (frame);
> - struct type *reg_type = register_type (gdbarch, regnum);
Oh, wait. Given multi-arch, the arch of FRAME might be different
from the prev frame's arch, and therefore the type of register
REGNUM should be retrieved from the unwound arch.
> + struct value *val;
>
> - return allocate_optimized_out_value (reg_type);
> + val = value_of_register_lazy (frame, regnum);
This is using the type of REGNUM in FRAME. I'll fix this
in a moment...
> + set_value_lazy (val, 0);
> + set_value_optimized_out (val, 1);
> + return val;
--
Pedro Alves