This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Make "set debug frame 1" output print <not saved> instead of <optimized out>.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]