Re: [PATCH 2/9] gdb: pass frame_info_ptr to gdbarch_value_from_register

Tom Tromey
2023-12-22T16:40:35Z

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> Pass a frame_info_ptr rather than a frame_id. This avoids having to do
Simon> a frame lookup on the callee side, when we can just pass the frame down
Simon> directly.

Simon> I think this fixes a bug in rs6000-tdep.c where the id of the wrong
Simon> frame was set to `VALUE_NEXT_FRAME_ID (v)`.

Simon> +value *
Simon> +default_value_from_register (gdbarch *gdbarch, type *type, int regnum,
Simon> + frame_info_ptr this_frame)

FWIW I tend to think new code should use 'const frame_info_ptr &' in
most places. It's more efficient and the design of frame_info_ptr also
makes it harmless, as the underlying frame_info member is mutable.

Tom