From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58136) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP7M8-0004F1-PR for qemu-devel@nongnu.org; Wed, 03 Sep 2014 06:00:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XP7M0-0001SZ-Pp for qemu-devel@nongnu.org; Wed, 03 Sep 2014 06:00:00 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:57037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XP7M0-0001Qj-Ga for qemu-devel@nongnu.org; Wed, 03 Sep 2014 05:59:52 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 3 Sep 2014 10:59:50 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 599A21B08069 for ; Wed, 3 Sep 2014 11:00:49 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s839xmhV48562250 for ; Wed, 3 Sep 2014 09:59:48 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s839xltT000861 for ; Wed, 3 Sep 2014 03:59:48 -0600 Date: Wed, 3 Sep 2014 11:59:45 +0200 From: David Hildenbrand Message-ID: <20140903115945.7d470664@thinkpad-w530> In-Reply-To: <20140903094540.GA16778@toto> References: <1409320338-63098-1-git-send-email-jfrei@linux.vnet.ibm.com> <1409320338-63098-6-git-send-email-jfrei@linux.vnet.ibm.com> <20140903113724.544f594b@thinkpad-w530> <20140903094540.GA16778@toto> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/5] gdb: provide the name of the architecture in the target.xml List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: Peter Maydell , Alexander Graf , QEMU Developers , Christian Borntraeger , Jens Freimann , "Vassili Karpov (malc)" , Cornelia Huck , Andreas =?UTF-8?B?RsOkcmJlcg==?= > On Wed, Sep 03, 2014 at 11:37:24AM +0200, David Hildenbrand wrote: > > > [ccing Andreas in case he wants to review the QOM aspects of this, > > > though they're fairly straightforward I think.] > > > > > > On 29 August 2014 14:52, Jens Freimann wrote: > > > > From: David Hildenbrand > > > > > > > > This patch provides the name of the architecture in the target.xml if available. > > > > > > > > This allows the remote gdb to detect the target architecture on its own - so > > > > there is no need to specify it manually (e.g. if gdb is started without a > > > > binary) using "set arch *arch_name*". > > > > > > This is neat; I didn't realise gdb let you do this. > > > > > > > The name of the architecture has been added to all archs that provide a > > > > target.xml (by supplying a gdb_core_xml_file) and have a unique architecture > > > > name in gdb's feature xml files. > > > > > > What about 32-bit ARM? You set the architecture name for AArch64 > > > but not the 32 bit case. > > > > > > > Well, my point was to not break anything :) > > > > On my way through the possible architecture names > > (binutils-gdb/gdb/features/*.xml), I wasn't able to come up with the right name > > for arm 32 bit (arm-core.xml) - they don't specify any. This patch therefore > > adapts to the xml files from gdb. > > > > The architecture should be known at the same point when specifying the xml file. > > So if anyone can come up with the proper arm name in the future (or even some > > kind of detection algorithm), it can simply be set in target-arm/cpu.c (after > > "arm-core.xml"). > > Hi, > > I've got some similar patches in my tree. I used the following: > Thanks! So "arm" seems to be the proper name for arm32, right? > > commit 26932a453da466d111b67c37b93dec71fb3ae111 > Author: Edgar E. Iglesias > Date: Wed Aug 20 19:22:10 2014 +1000 > > gdbstub: Emit the CPUs GDB architecture if available > > Allows GDB to autodetect the architecture. > > Signed-off-by: Edgar E. Iglesias > > diff --git a/gdbstub.c b/gdbstub.c > index 7f82186..5b62c50 100644 > --- a/gdbstub.c > +++ b/gdbstub.c > @@ -604,6 +604,11 @@ static const char *get_feature_xml(const char *p, const char **newp, > pstrcat(target_xml, sizeof(target_xml), r->xml); > pstrcat(target_xml, sizeof(target_xml), "\"/>"); > } > + if (cc->gdb_arch) { > + pstrcat(target_xml, sizeof(target_xml), ""); > + pstrcat(target_xml, sizeof(target_xml), cc->gdb_arch); > + pstrcat(target_xml, sizeof(target_xml), ""); > + } Please not that "gdb-target.dtd" specifies the architecture to come directly at the beginning of the target "section". Putting it after the xml-includes, to the end of the target section makes the whole XML failing to be recognized on my tests with s390x. David > pstrcat(target_xml, sizeof(target_xml), ""); > } > return target_xml; >