This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] arc: Add evaluation of long jump targets
Anton Kolesov <Anton.Kolesov@synopsys.com> writes:
> Standard get_longjmp_target implementation, similar to what is in arm-tdep.c.
> Actual value of jb_pc should be set in init_osabi methods of particular OS/ABI
> implementations.
>
Patch is good to me, two nits below,
> gdb/ChangeLog:
>
> * arc-tdep.h (gdbarch_tdep): Add jb_pc.
* arc-tdep.h (struct gdbarch_tdep) <jb_pc>: New field.
> * arc-tdep.c (arc_get_longjmp_target): New function.
> (arc_gdbarch_init): Set get_longjmp_target if jb_pc is non-negative.
> (arc_dump_tdep): Print jb_pc.
> ---
> gdb/arc-tdep.c | 36 +++++++++++++++++++++++++++++++++++-
> gdb/arc-tdep.h | 3 +++
> 2 files changed, 38 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
> index 58de8e9..bc8bb98 100644
> --- a/gdb/arc-tdep.c
> +++ b/gdb/arc-tdep.c
> @@ -557,6 +557,34 @@ arc_store_return_value (struct gdbarch *gdbarch, struct type *type,
> error (_("arc_store_return_value: type length too large."));
> }
>
> +/* Implement the "get_longjmp_target" gdbarch method.
> +
> + Detemine the address the longjmp will jump to. We need to use the frame
> + info to get the register pointing to the jmp_buf, then extract the PC from
> + that. Since jmp_buf is the first argument to longjmp () it will be in r0.
> + Where we then go depends on the OS - OS/ABI initialization should set offset
> + from jmp_buf start to the stored PC location. */
> +
I don't see any extra information these comments have, so the first
sentence is enough, IMO.
/* Implement the "get_longjmp_target" gdbarch method. */
> +static int
> +arc_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
> +{
--
Yao (齐尧)