From patchwork Thu Nov 16 10:07:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 24284 Received: (qmail 74981 invoked by alias); 16 Nov 2017 10:07:50 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 74385 invoked by uid 89); 16 Nov 2017 10:07:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KB_WAM_FROM_NAME_SINGLEWORD, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: EUR02-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr00041.outbound.protection.outlook.com (HELO EUR02-AM5-obe.outbound.protection.outlook.com) (40.107.0.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 16 Nov 2017 10:07:46 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com (10.160.211.19) by AM3PR08MB0101.eurprd08.prod.outlook.com (10.160.211.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Thu, 16 Nov 2017 10:07:42 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::2891:52f2:59:8e54]) by AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::2891:52f2:59:8e54%16]) with mapi id 15.20.0218.015; Thu, 16 Nov 2017 10:07:42 +0000 From: Alan Hayward To: Yao Qi CC: "gdb-patches@sourceware.org" , nd Subject: Re: [PATCH] Allow osabi to be optional in target descriptors Date: Thu, 16 Nov 2017 10:07:42 +0000 Message-ID: <71081D3D-57E8-43DC-908A-891E7ADB92C7@arm.com> References: <864lputwf1.fsf@gmail.com> In-Reply-To: <864lputwf1.fsf@gmail.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM3PR08MB0101; 6:6/nK4SPDFf+Y1cEDYfjmj6lxzTI2adURp+H8MZfWoI9+xT69C3jKlWTEW9S3hDRu3cFoJ0IJ/gxS+jOYFfJUwbNS2KW6EirRxAS4QnEnG+XuuYzoPl8Ji19QZhgB0qG8Tbgie9MJaQIBhs2xgXreHTD6dHbrEGYNNLjI4z8PCUB5IoKLb2VlUu7AEGrNOuZPdbW1qLcOcsBmx6bcjxfK+hxMDWTVx9c4okQmbr0P9R4MJgXdpePT5a0rJDWnjWmEsehYBdPqxddiNprzp94rKbUDFe7w6LNvf8a2Ha4phBr3vYv/jbtyK35QdvT3/DGalVbryLTMCbImCS124JmjJpWGw6fqxigyL3vw7WG6CJg=; 5:7cVQjQPPJtyfmtQiE9kYcZz2O5nZks4BZJmlcIsNPfa+85hHqnYoZACnex6IYWzZUJKN8yZb76499C3E77xF7XqxlwjRpKDxhzdL/N02UPi1HQMacB4ElORp19hyGVpeRfKeRLAJX++GNu9qjH2DMEGPk8nRLceBu4CobSqCBoY=; 24:h1ctBcaw+EsDFLxSr1Pd/s9o3w1YLSR/55vUo4BP0kxPXFTSs6vyUnpahB5xRw5kj/Df0HINxmnAgwHPO233/RDcoIQC77AbidvT1NvmoQU=; 7:qOLADQk6lQqSvup0gStlZLc2Klz5GFx4NknMJNOybh9RLg2lamW/5PnBkJHjEU6BJgjQkApuGEGXf1w+iJZ5UP8tBwiq4vH6VJjl+RLG6HwRHWzQ6DQ/2BiQgMldeNyTv90VQPHnw97XkrdlXC0lRQQtrmrdYPZouxI17H/9vjR/jMTsyJU5WLqPeTPhE+cdPa8TjhUb3wIdTZOeTCG9Ne72ua3fT6hSa9cjt0Ormv1FMaOU783Ns0iU3ZpO5BLe x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 5a179f0a-95b3-412b-9927-08d52cd9e051 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603258); SRVR:AM3PR08MB0101; x-ms-traffictypediagnostic: AM3PR08MB0101: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(3231022)(6055026)(6041248)(20161123560025)(20161123558100)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM3PR08MB0101; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM3PR08MB0101; x-forefront-prvs: 0493852DA9 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(199003)(24454002)(189002)(81166006)(102836003)(33656002)(5660300001)(966005)(68736007)(25786009)(36756003)(2950100002)(6916009)(101416001)(2900100001)(53546010)(7736002)(81156014)(305945005)(3660700001)(76176999)(8676002)(6116002)(82746002)(316002)(478600001)(106356001)(72206003)(105586002)(54356999)(54906003)(50986999)(3280700002)(8936002)(2906002)(86362001)(189998001)(99286004)(66066001)(6306002)(83716003)(3846002)(14454004)(97736004)(53936002)(6246003)(6436002)(229853002)(1411001)(6506006)(6512007)(6486002)(5250100002)(4326008)(39060400002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR08MB0101; H:AM3PR08MB0101.eurprd08.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-ID: <28EA2D665F2DDD4785E1D46617B354C8@eurprd08.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a179f0a-95b3-412b-9927-08d52cd9e051 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Nov 2017 10:07:42.4356 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0101 X-IsSubscribed: yes > On 16 Nov 2017, at 09:17, Yao Qi wrote: > > Alan Hayward writes: > > Patch is good to me, some nits on commit log and code, > >> Osabi is an option field in target descriptors, according to: > > s/target descriptors/target descriptions/ > >> https://sourceware.org/gdb/current/onlinedocs/gdb/Target-Description-Format.html >> >> However, removing the osabi field from the i386 and amd64 target descriptors > > Likewise. > >> >> The following patch fixes this error. >> >> Tested with gdbserver on x86 and also on aarch64 with my target descriptor patch. > > Likewise. > >> @@ -105,9 +104,12 @@ tdesc_get_features_xml (target_desc *tdesc) >> buffer += tdesc->arch; >> buffer += ""; >> >> - buffer += ""; >> - buffer += tdesc->osabi; >> - buffer += ""; >> + if (tdesc->osabi != NULL) > > As we are in C++, I prefer nullptr. > > s/NULL/nullptr/ > Thanks. Pushed with changes as above. diff --git a/gdb/gdbserver/tdesc.c b/gdb/gdbserver/tdesc.c index 63d6467d56d168777f4fa39b56495dd5649c046b..e2c4288efba1546247a3b376da3c573c223b6eef 100644 --- a/gdb/gdbserver/tdesc.c +++ b/gdb/gdbserver/tdesc.c @@ -92,8 +92,7 @@ tdesc_get_features_xml (target_desc *tdesc) /* Either .xmltarget or .features is not NULL. */ gdb_assert (tdesc->xmltarget != NULL || (tdesc->features != NULL - && tdesc->arch != NULL - && tdesc->osabi != NULL)); + && tdesc->arch != NULL)); if (tdesc->xmltarget == NULL) { @@ -105,9 +104,12 @@ tdesc_get_features_xml (target_desc *tdesc) buffer += tdesc->arch; buffer += ""; - buffer += ""; - buffer += tdesc->osabi; - buffer += ""; + if (tdesc->osabi != nullptr) + { + buffer += ""; + buffer += tdesc->osabi; + buffer += ""; + } char *xml;