From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26521 invoked by alias); 1 Mar 2018 11:38:33 -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 26376 invoked by uid 89); 1 Mar 2018 11:38:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=fort, sixth, H*r:15.20.0527.022, H*RU:15.20.0527.022 X-HELO: EUR03-AM5-obe.outbound.protection.outlook.com Received: from mail-eopbgr30085.outbound.protection.outlook.com (HELO EUR03-AM5-obe.outbound.protection.outlook.com) (40.107.3.85) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Mar 2018 11:38:29 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com (10.160.211.19) by AM3PR08MB0689.eurprd08.prod.outlook.com (10.163.189.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.527.15; Thu, 1 Mar 2018 11:38:26 +0000 Received: from AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::fc60:4b4d:7de8:f8b7]) by AM3PR08MB0101.eurprd08.prod.outlook.com ([fe80::fc60:4b4d:7de8:f8b7%16]) with mapi id 15.20.0527.022; Thu, 1 Mar 2018 11:38:26 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd Subject: [PATCH V3 0/8] Remove gdbserver dependency on xml files Date: Thu, 01 Mar 2018 11:38:00 -0000 Message-ID: <757A8B89-2EF0-46BD-BAA6-6E668538B17F@arm.com> authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM3PR08MB0689;7:gOFluHCNGIIold+IqrqwHXsjKkisoZ7Wdar/C8lRa/y2A3mjgy1lLxl/NoqNQ4TVLvHyhbY18N8hbu0xjVEbTz7CYQc/QEbfFQY+k+O3ARe2Rn3C5ivDvlMvv5RIIBhDcPz4wR9JHIGZFZaZFyyWs7I3X/qSP3o/0xP0X06YiNBfCzCKAgMCLI/p3BqIyKiRIhb0UQmTxvicyUPQcthlc7kTiwAQBZwy/UFSB0PP/w4gOxeHlkpm868+eanPA3ro x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 5b6aa5a2-accf-477a-8f3e-08d57f68f28d x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7153060)(7193020);SRVR:AM3PR08MB0689; x-ms-traffictypediagnostic: AM3PR08MB0689: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040501)(2401047)(5005006)(8121501046)(3231220)(944501227)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041288)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:AM3PR08MB0689;BCL:0;PCL:0;RULEID:;SRVR:AM3PR08MB0689; x-forefront-prvs: 05986C03E0 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(346002)(396003)(39860400002)(366004)(376002)(39380400002)(20264003)(189003)(199004)(5640700003)(6512007)(14454004)(86362001)(25786009)(26005)(66066001)(5250100002)(2900100001)(2501003)(305945005)(97736004)(3660700001)(4326008)(83716003)(7736002)(6506007)(106356001)(99286004)(2906002)(68736007)(53936002)(82746002)(102836004)(5660300001)(3280700002)(72206003)(316002)(478600001)(6436002)(8676002)(186003)(6486002)(81156014)(2351001)(81166006)(8936002)(33656002)(6916009)(105586002)(36756003)(6116002)(3846002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR08MB0689;H:AM3PR08MB0101.eurprd08.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: kcZB39oB8rMeJ3Npmj+8QAL3lTNT7MRe72HYye50O2rI4kB/EipfHSF/nMXnfQOj3hduxHbLo2br6peivVBkQwL23cQCRXUAQJ6p/HhbKRbi4K+ZXJc+bVtfp+6iSs+1fWjh1RB1mK96NnLI3/6hh9mFo8v8W5JOHXq0/fIK7t4= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b6aa5a2-accf-477a-8f3e-08d57f68f28d X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Mar 2018 11:38:26.3920 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0689 X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00008.txt.bz2 V3 builds on previous review comments, and the additional patches I've already pushed. Complete patch series pushed to branch users/ahayward/xml3. Summary: For those targets that use new style target descriptions, this set of patch= es removes the dependency on xml files. Namely: * Removes inclusion of xml files within gdbserver. * Removes the requirement for the .c files in features/ to be generated from cached xml files. This is made possible by changing xml descriptions generated by gdbserver, = so that instead of including xml file names, gdbserver now generate a complete xml description. The second point will be required for aarch64 SVE support, where the regist= er size are variable. Creating SVE xml files for every possible vector length would not be feasible. Instead the plan for aarch64 SVE is to hand write the features/ .c code that would normally be generated from xml. XML Generation: In existing code, gdbserver uses C code auto generated from xml files to create target descriptions. When sending an xml description to GDB, the function tdesc_get_features_xml () creates an xml containing the name of the original xml file(s). For example: i386 GNU/Linux Upon receipt, GDB then makes requests to gdbserver for the contents of the xml files. Gdbserver keeps full copies all the xml files inside the binary. This patch series adds common code that allows gdbserver (and gdb) to turn a C target description structure into xml. Now when asked fort an xml description to gdb, gdbserver turns the entire target description structure back into xml, without using any cached files. Producing, for example: i386 GNU/Linux ...etc... Patch Contents: Patches 2-4 commonise the various target descriptor functionality, allowing gdbserver to parse target descriptions in the same way as gdb. This series does not commonise target_desc, but this is hopefully a long term goal. The sixth patch adds the xml printer, which iterates through the parsing generated in the previous patches. The other patches are clean up patches. Patches have been tested on a make check on x86 targets=3Dall build with target board unix native-gdbserver. Also tested aarch64. Built for power (because it does not use new target descriptions), but am unable to test. In addition, patch six adds new test cases to unit test. Alan. gdb/Makefile.in | 2 + gdb/common/tdesc.c | 445 +++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++ gdb/common/tdesc.h | 313 +++++++++++++++++++++++++++++++++= +++++++++++++++++++++- gdb/features/aarch64-core.c | 2 +- gdb/features/aarch64-fpu.c | 2 +- gdb/features/i386/32bit-avx.c | 2 +- gdb/features/i386/32bit-avx512.c | 2 +- gdb/features/i386/32bit-core.c | 2 +- gdb/features/i386/32bit-linux.c | 2 +- gdb/features/i386/32bit-mpx.c | 2 +- gdb/features/i386/32bit-pkeys.c | 2 +- gdb/features/i386/32bit-sse.c | 2 +- gdb/features/i386/64bit-avx.c | 2 +- gdb/features/i386/64bit-avx512.c | 2 +- gdb/features/i386/64bit-core.c | 2 +- gdb/features/i386/64bit-linux.c | 2 +- gdb/features/i386/64bit-mpx.c | 2 +- gdb/features/i386/64bit-pkeys.c | 2 +- gdb/features/i386/64bit-segments.c | 2 +- gdb/features/i386/64bit-sse.c | 2 +- gdb/features/i386/x32-core.c | 2 +- gdb/features/tic6x-c6xp.c | 2 +- gdb/features/tic6x-core.c | 2 +- gdb/features/tic6x-gp.c | 2 +- gdb/gdbserver/Makefile.in | 3 + gdb/gdbserver/configure.srv | 36 ------- gdb/gdbserver/tdesc.c | 240 ++++++++++++++++++---------------= --------- gdb/gdbserver/tdesc.h | 57 ++-------- gdb/regformats/regdat.sh | 5 +- gdb/target-descriptions.c | 596 ++++++++++++---------------------= ----------------------------------------------------------------------- gdb/xml-tdesc.c | 9 ++ gdb/xml-tdesc.h | 5 + 32 files changed, 974 insertions(+), 779 deletions(-)