From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66542 invoked by alias); 31 May 2018 16:13:08 -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 66519 invoked by uid 89); 31 May 2018 16:13:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-12.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-he1eur01on0064.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (104.47.0.64) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 16:13:05 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.226.148) by DB6PR0802MB2471.eurprd08.prod.outlook.com (10.172.251.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.11; Thu, 31 May 2018 16:13:01 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::d984:bdee:1856:c64]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::d984:bdee:1856:c64%7]) with mapi id 15.20.0820.010; Thu, 31 May 2018 16:13:01 +0000 From: Alan Hayward To: Pedro Alves CC: "gdb-patches@sourceware.org" , nd Subject: Re: [PATCH 4/8] Enable SVE for GDB Date: Thu, 31 May 2018 16:20:00 -0000 Message-ID: References: <20180511105256.27388-1-alan.hayward@arm.com> <20180511105256.27388-5-alan.hayward@arm.com> <8455164b-72c9-61d5-17c0-c77304d588ce@redhat.com> In-Reply-To: <8455164b-72c9-61d5-17c0-c77304d588ce@redhat.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DB6PR0802MB2471;7:XANeAW6KFTHKnk+EMFjJ843VUlHOXsxxDQnlHR/41FvLEAWRzy+wbXfNRM/VE3yh/lPegKqN07GxWn/H2Vp+cm+HK0QECOU1Pak3FHpL3oa7NRM4ZjCZmKxgcoEdcOV431hdMuAAz9hAE6us9ZOcTimYAbyN1y+FsrWDZZwi+/kSt62ou1AVIZaAYcW4u9X+cXXmko1rVHjtsVxJxcgD14a86/t151sTR1rRvYyAx5Do9eUMJzY/nj6hlNJGxuLr x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DB6PR0802MB2471; x-ms-traffictypediagnostic: DB6PR0802MB2471: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:DB6PR0802MB2471;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0802MB2471; x-forefront-prvs: 06891E23FB x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(979002)(39380400002)(39860400002)(396003)(346002)(366004)(376002)(199004)(189003)(305945005)(81156014)(186003)(86362001)(7736002)(26005)(105586002)(106356001)(14454004)(53936002)(316002)(53546011)(97736004)(54906003)(57306001)(36756003)(66066001)(6512007)(72206003)(68736007)(102836004)(6506007)(6246003)(8936002)(99286004)(76176011)(6436002)(2906002)(5250100002)(6486002)(2900100001)(82746002)(2616005)(476003)(50226002)(4326008)(83716003)(486006)(478600001)(3280700002)(81166006)(25786009)(3846002)(6116002)(5660300001)(3660700001)(11346002)(229853002)(8676002)(446003)(6916009)(33656002)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB6PR0802MB2471;H:DB6PR0802MB2133.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: eeQ1cv8mrUINBdZsjzZ2fuT2C+q1iDP9XC3/JtKaUqiZqq5z+q8jdfLCbBcr4c+7B2CnrL96+uFTuZsVijqKXVzxW4ocT8uvTevnu2/EqNMqX/HU7lGKINC087+9HCmPZ6h+puOmsFWAs+ZrJYi50updsVVmeMWK0eOdBS0kGgeq9drnHcBwFBfYYTR2bJmv spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <9321FE88F422334B8CF431E538DF0CDC@eurprd08.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: c0e9083a-c978-4365-eb31-08d5c71161ed X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0e9083a-c978-4365-eb31-08d5c71161ed X-MS-Exchange-CrossTenant-originalarrivaltime: 31 May 2018 16:13:01.2855 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2471 X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00861.txt.bz2 DQoNCj4gT24gMzEgTWF5IDIwMTgsIGF0IDE1OjU5LCBQZWRybyBBbHZlcyA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CB3ZSBuZWVkIGl0IGFzIGEgZHdhcmYgcmVnaXN0ZXIuKSBJIG1h ZGUgaXQgNjRiaXRzIHRvIG1hdGNoIHRoZQ0KbWluaW11bSBzaXplIG9mIGFs bCB0aGUgb3RoZXIgYWFyY2g2NCByZWdpc3RlcnMuDQpJIGRpZCBoYXZlIGl0 IGFzIDE2Yml0cyBhdCBvbmUgcG9pbnQsIGJ1dCBpdCB3ZW50IHdyb25nIHdo ZW4gdXNpbmcgaXQNCndpdGggZHdhcmYgYXMgaXQgZXhwZWN0cyBhbGwgdGhl IGR3YXJmIHJlZ2lzdGVycyB0byBiZSB0aGUgbWluaW11bQ0KcmVnaXN0ZXIu DQoNCkkgY2hvc2UgdG8gZG8gdGhlIGNvbnZlcnNpb24gZnJvbSAxNmJpdHMg dG8gNjRiaXRzIGF0IHRoZSBwb2ludCB2ZyBpcw0KcmVhZCBmcm9tIHRoZSBr ZXJuZWwuIFRoaXMgbWFrZXMgdGhlIGNvZGUgZWFzeSBhcyBmcm9tIHRoZW4g b24gYXMgaXTigJlzDQphbHdheXMgNjRiaXRzIHRocm91Z2hvdXQuDQoNCkFs dGVybmF0aXZlbHksIEkgY291bGQgaGF2ZSBrZXB0IGFzIDE2Yml0cyB1cCB0 byB0aGUgcG9pbnQgaXQgaGl0cw0KdGhlIHJlZ2NhY2hlLiBCdXQgdGhhdCBs ZWF2ZXMgdHdvIGRpZmZlcmVudCB0eXBlcyBhcm91bmQgdGhlIGNvZGUuDQoN Cg0KQWxhbi4NCg0K >From gdb-patches-return-147843-listarch-gdb-patches=sources.redhat.com@sourceware.org Thu May 31 16:18:27 2018 Return-Path: Delivered-To: listarch-gdb-patches@sources.redhat.com Received: (qmail 92536 invoked by alias); 31 May 2018 16:18:27 -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 Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 92526 invoked by uid 89); 31 May 2018 16:18:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=ulongest, ULONGEST X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 May 2018 16:18:25 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 72912401EF10; Thu, 31 May 2018 16:18:24 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id CCEDA1134CA6; Thu, 31 May 2018 16:18:23 +0000 (UTC) Subject: Re: [PATCH 4/8] Enable SVE for GDB To: Alan Hayward References: <20180511105256.27388-1-alan.hayward@arm.com> <20180511105256.27388-5-alan.hayward@arm.com> <8455164b-72c9-61d5-17c0-c77304d588ce@redhat.com> Cc: "gdb-patches@sourceware.org" , nd From: Pedro Alves Message-ID: <2c87cd8d-c608-4ccf-b16a-635168dbb250@redhat.com> Date: Thu, 31 May 2018 16:27:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2018-05/txt/msg00862.txt.bz2 Content-length: 1815 On 05/31/2018 05:13 PM, Alan Hayward wrote: > > >> On 31 May 2018, at 15:59, Pedro Alves wrote: >> >> On 05/11/2018 11:52 AM, Alan Hayward wrote: >>> --- a/gdb/aarch64-tdep.c >>> +++ b/gdb/aarch64-tdep.c >>> @@ -2873,6 +2873,26 @@ aarch64_read_description (long vq) >>> return tdesc; >>> } >>> >>> +/* Return the VQ used when creating the target description TDESC. */ >>> + >>> +static long >>> +aarch64_get_tdesc_vq (const struct target_desc *tdesc) >> >> Is this use of "long" significant? I mean, is it assuming 64-bit? >> I ask because longs are not 64-bit on x64 Windows, so it would >> do the wrong thing when cross debugging. > > In the kernel structure it’s a 16bit value. > > However, the VG "register" in the regcache is a 64bit value. (It’s not > a real system register, but helps a great deal to see it as one in gdb, > and we need it as a dwarf register.) I made it 64bits to match the > minimum size of all the other aarch64 registers. OK, fine to make it 64-bit, but then the "do the wrong thing when cross debugging" point applies. "long" is 32-bit on some hosts. I don't really know what values VG can take -- can they be negative? I.e., is sign extension expected? You did not seem to address this in your reply. Why not use host-independent ULONGEST, for example? > I did have it as 16bits at one point, but it went wrong when using it > with dwarf as it expects all the dwarf registers to be the minimum > register. > > I chose to do the conversion from 16bits to 64bits at the point vg is > read from the kernel. This makes the code easy as from then on as it’s > always 64bits throughout. > > Alternatively, I could have kept as 16bits up to the point it hits > the regcache. But that leaves two different types around the code. Thanks, Pedro Alves