Re: [PATCH 4/8] gdb/s390: Fill gen_return_address hook.

Andreas Arnez
2016-03-11T11:20:17Z

On Sun, Feb 07 2016, Marcin Kościelnicki wrote:

> diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
> index 97bd564..0b91ed1 100644
> --- a/gdb/s390-linux-tdep.c
> +++ b/gdb/s390-linux-tdep.c
> @@ -627,6 +627,18 @@ s390_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
> return 0;
> }
>
> +/* The "gen_return_address" gdbarch method. */
> +
> +static void
> +s390_gen_return_address (struct gdbarch *gdbarch,
> + struct agent_expr *ax, struct axs_value *value,
> + CORE_ADDR scope)
> +{
> + value->type = register_type (gdbarch, S390_R14_REGNUM);
> + value->kind = axs_lvalue_register;
> + value->u.reg = S390_R14_REGNUM;
> +}

Under which circumstances is this supposed to work? And how reliable
does it need to be? The ABI only guarantees that r14 holds the return
address at function entry. Anywhere else it likely doesn't.

--
Andreas