From: Kevin Buettner <kevinb@redhat.com>
To: Andreas Arnez <arnez@linux.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] S390: Fix crash when remote tdesc doesn't define vec128
Date: Fri, 19 Oct 2018 11:32:00 -0000 [thread overview]
Message-ID: <20181019043248.15c3753f@pinnacle.lan> (raw)
In-Reply-To: <m3lg6vgmy9.fsf@oc0404454431.ibm.com>
Hi Andreas,
It needs a ChangeLog entry, but aside from that it looks okay to me.
Kevin
On Thu, 18 Oct 2018 19:54:22 +0200
Andreas Arnez <arnez@linux.ibm.com> wrote:
> I've encountered a GDB crash when trying to read registers from a remote
> stub that provided a target.xml with vector registers, but without the
> 'vec128' data type. The crash is caused by NULL register type entries for
> the "concatenated" pseudo-registers v0-v15. These NULL entries are
> introduced by the logic in s390_pseudo_register_type(), where the tdesc
> type 'vec128' is returned unconditionally -- even if it doesn't exist (is
> NULL).
>
> The fixed logic for determining a "concatenated" vector register's type
> now returns the type of the raw register v16 instead. This also makes
> sure that all vector register have the same type.
> ---
> gdb/s390-tdep.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
> index 81fa0329ea..23689aa71a 100644
> --- a/gdb/s390-tdep.c
> +++ b/gdb/s390-tdep.c
> @@ -1275,8 +1275,9 @@ s390_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
> if (regnum_is_gpr_full (tdep, regnum))
> return builtin_type (gdbarch)->builtin_uint64;
>
> + /* For the "concatenated" vector registers use the same type as v16. */
> if (regnum_is_vxr_full (tdep, regnum))
> - return tdesc_find_type (gdbarch, "vec128");
> + return tdesc_register_type (gdbarch, S390_V16_REGNUM);
>
> internal_error (__FILE__, __LINE__, _("invalid regnum"));
> }
> --
> 2.17.0
>
next prev parent reply other threads:[~2018-10-19 11:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-18 17:54 Andreas Arnez
2018-10-19 11:32 ` Kevin Buettner [this message]
2018-10-19 12:10 ` Andreas Arnez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181019043248.15c3753f@pinnacle.lan \
--to=kevinb@redhat.com \
--cc=arnez@linux.ibm.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox