From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7755 invoked by alias); 19 Oct 2018 11:32:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 7731 invoked by uid 89); 19 Oct 2018 11:32:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=aside X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Oct 2018 11:32:50 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A562F30F5597; Fri, 19 Oct 2018 11:32:49 +0000 (UTC) Received: from pinnacle.lan (ovpn-117-243.phx2.redhat.com [10.3.117.243]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 265AA5ED36; Fri, 19 Oct 2018 11:32:49 +0000 (UTC) Date: Fri, 19 Oct 2018 11:32:00 -0000 From: Kevin Buettner To: Andreas Arnez Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] S390: Fix crash when remote tdesc doesn't define vec128 Message-ID: <20181019043248.15c3753f@pinnacle.lan> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00427.txt.bz2 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 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 >