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 4/8] gdb/s390: Fill gen_return_address hook.


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


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