From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52094 invoked by alias); 10 Apr 2018 14:34:05 -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 52083 invoked by uid 89); 10 Apr 2018 14:34:04 -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,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=boards, SYSTEM, 1-3, UD:dtd X-HELO: EUR02-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr10088.outbound.protection.outlook.com (HELO EUR02-HE1-obe.outbound.protection.outlook.com) (40.107.1.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Apr 2018 14:34:02 +0000 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; Received: from c02tf0u7hf1t.manchester.arm.com (217.140.96.140) by HE1PR0802MB2138.eurprd08.prod.outlook.com (2603:10a6:3:c2::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Tue, 10 Apr 2018 14:33:51 +0000 From: Alan Hayward To: gdb-patches@sourceware.org Cc: nd@arm.com, Alan Hayward Subject: [PATCH v5 0/8] Remove gdbserver dependency on xml files Date: Tue, 10 Apr 2018 14:34:00 -0000 Message-Id: <20180410143337.71768-1-alan.hayward@arm.com> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: CWXP265CA0019.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:2e::31) To HE1PR0802MB2138.eurprd08.prod.outlook.com (2603:10a6:3:c2::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e08bb8f1-b3b3-497a-7478-08d59ef014e9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:HE1PR0802MB2138; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0802MB2138;3:K9pK6Agyf8ODQxgoWaZTviOQvzlw6CfkqhQUm3aLvdzl0oqo/AKvS2NIZjyRz0WzlXNUs6+NvUVcJGAbkpSj4Ngmpzz4DCuVX64sTSVyveXRxF1z53p/ti82Rq0Y2SwV87f2lLBaycGKTFw2sR/Pof0d00FemOizCF2Ke9I9B3JxkjKoYO1hAonqu8d9xh/bEeLS7lc/QoLtt1LsSkz16peCV9+jbVyH6h9DRWUFZbdbQbHDiOuNTHzDe6Bq/Kyf;25:KV7cjYujST6EyRSilup0yNeK2Lzpu3NDaLPBXCPczutb0/3Kgvyxk0RaZimCb2fZ5CQHN+9x8tGzt3Hv29t5UoiVzmwQnaqGg23vU5qTCZT/q7XRNdTop3f2g30aSJnHHS48mujiOJw4bYt7hrXdUhT5Pobw8bPbPMCteOKDF7zejUbptpMAKZmxod/dz6/tCWlx3aZCwo4WIneYRvOslXUzREz1EVU39g03qmVR24YIj7TraG0bXgxVb4LCCrz2H0XRy0dF6U0E1r9A9LgL58bhzSS27I7OJahaOOJeomXRcF582j18LUiTDTV/vOnBAMrET7E8wxQtpfPtINBk5g==;31:Qk5FugSrVKDRV1Yz6Oovi94HCeshXC1U8Cqr5DKKK7id+8kdEUsUq23fnkybZTaaqpG71vidqYsghdsVOfdrF3Sm7XSuzPzVazDiqlFgl1V8DYLS+7C61J6g9cZNz4gKa+/NyIyOZXnABiYu9Us51JLWa2Sdb209I0Nd72P4rsRT9YrexoQAlt73PfgXyNaOBcuLIGF/kYs3jTYGaleq1iZPiuA4WG4YX0Zw3i86NPU= X-MS-TrafficTypeDiagnostic: HE1PR0802MB2138: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1;HE1PR0802MB2138;20:dEM49mK+1S1/iwaOUMQfGhhUvlkrXIf5Dj5rLsr03BtIDblknLJe5IzRQ+nNOvAK0yEZgia9K407DlflbYwUGtE45LnNd2izCDcib5+Ihf47+h1KrMxpCrCyx7N2/yPYUEhCx/eigxh8vFabfZ9D5Z6AiChYuV0Yay8+shdgtZ0=;4:vquaeV0PC5aqboYaHGg5or85NJzGQxN53cobBkrFvKSeo7tQy4R/fMvYYEGPTJOX8W9194sB9h0gPO5HvQV9/Pg34CH1TBfGTOKS2CFPHkDA1udQFb8e0gb9gV1+4jI3D8fdtcnwRg+lrrd/JiEoDO/jaBGXT6MbkdkXjzAC1FiGa79DgC8mXs/GcvXkS9V8xHs3UzhtNgiy6v/N6ahZ8yQSqVpRUxqUXHkfM++1LqEcNxkEDAhNfGMs/aroWFSJF+qreOWhDXjjXAUt7PP1NXnU11AaY4fQnRK07CEEUox5BGUScZ5X2druyJ83eyY7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:HE1PR0802MB2138;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0802MB2138; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39380400002)(396003)(346002)(39860400002)(366004)(376002)(20264003)(189003)(199004)(386003)(52116002)(7696005)(36756003)(51416003)(6486002)(105586002)(21490400003)(486006)(6666003)(6916009)(476003)(2906002)(3846002)(2616005)(6116002)(956004)(2361001)(1076002)(2351001)(186003)(316002)(26005)(86362001)(16526019)(8676002)(68736007)(16586007)(81166006)(81156014)(5660300001)(7736002)(8936002)(53936002)(106356001)(4326008)(478600001)(66066001)(305945005)(25786009)(48376002)(97736004)(72206003)(50226002)(50466002)(47776003);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0802MB2138;H:c02tf0u7hf1t.manchester.arm.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR0802MB2138;23:Ze6gejmR4D6VURoZXP6sBRRj8cT28hPnXR/oRMB?= =?us-ascii?Q?/epy0AEahiCT7O+spvYKqzB41Y4/UqJwXvFxZPjvwozGBkd4bTFPCpv0wemB?= =?us-ascii?Q?PlsNaEk207PgVPdsmSdIxmJbaHxBrs1AorXmsyBkcwLfQAtHWCgr5dwWKy68?= =?us-ascii?Q?4stDji3DOgx0e6zxWD203/8I9FFKhcMpu4SNaUiguX+f0C1D3x94n8UXPwdZ?= =?us-ascii?Q?kTLwdEGjQcMAvesK8m5Nm4H/J9LwAt9PJBSvD8T5fYgQzKLbtoPcNvf+B0FI?= =?us-ascii?Q?g7YnLbvUNBQjtd27HdQKmjmFt/zZyFhfFqKDqZT+rkLOwv5lQsCrNOrw8+Jh?= =?us-ascii?Q?lCGVi2/1n/cZVLJ+DLRNleNCJP8iSdDd7Ut0P0YjMInh24tcUyAwX7f06GZK?= =?us-ascii?Q?IPWZWNAzZffJNYo01dPAacTNOt1woDSAqB66QK5VsehGM97p+cVi1cp9vSKX?= =?us-ascii?Q?qUEFHJoWM+kldRuqHYDjG/rHozJ2vgznbzHauRAEGs0HPrh+m1QumQ3iNCx4?= =?us-ascii?Q?EQaE8oa8HPP78jFvrTdwwyhT09tMi/UaiQJa+muQVfuVv65zIWUZK8gGWaWF?= =?us-ascii?Q?L5YvUyjXYp4JpjLAEUKBvWu3rP1MuxVRPtY4BNVKT3nRDVIa9A6td2wABdox?= =?us-ascii?Q?ngkRuYF5oBqa8IBG1NsO0hEEpubllLPjOJx4LGzwdENEy2fuRouSAXaOL9gR?= =?us-ascii?Q?Y9uaY/UkEeufb+RRz3TX08jaR+AbqXD+QYuWgRrYwNfECP7wadbcLsocIuac?= =?us-ascii?Q?nEIk5zMIpQiW1JV0GrFNWGEWiCvqzSXqX4KnkfPTgIpOR/LH13xmLg+2IXRb?= =?us-ascii?Q?QKIWfVIAn6Ty2wvzsO/qK1b8jgsXTxxcLUQDNhIAD96As0ix+jnJwYvqW8va?= =?us-ascii?Q?MjgTo1H0mxK6sW7j7Zd1EtAVdIID69ta0BUQo97zg2kxGy+DMD2Xr85auuEw?= =?us-ascii?Q?PXwbvxwQEWc94/TF88/zeijwAWbBqUqOudTtTkBui6LlgOopGd3u63KyPr6Z?= =?us-ascii?Q?tW+nXqVlq3OdKjiSn/MhhF0rtkob5hZEtGWk4YxnVfP7FhJLQeMu8Otcngf9?= =?us-ascii?Q?GChdpktQgu47dLIBSDBe1VHeY2TD6D2Mktq2ZxSVeawZX8Z14Yh7knWPDJRO?= =?us-ascii?Q?jRpgUHwFpQSXiB693FdG8TdbCiWQ7QC1nFRhDQ0oXPsry/+CJ6ykIGYJ9Koe?= =?us-ascii?Q?RgIM6Z0e6jIWhvjlWA4/j1ANjM+W7jRgnOXcoVThfirWMDgjAgmqJmRYYGg?= =?us-ascii?Q?=3D=3D?= X-Microsoft-Antispam-Message-Info: HjaZBBSN4wPbRJgV0HIq/AD2PG8HU6w1J4v5pj/kaWWm9jERgeAN1kugQPgE6xebtJZubi2F+xR9dx03QaHxlCZeNymKQ+42kJr+qqvTyn4ca45eHJS//t2HQJZUa1S7PtaYIuvfHgsHxaU2+QhOE0SG2SYinsceuX7tdZYpWmICZz5qRhyNmHdPJnSHjXUI X-Microsoft-Exchange-Diagnostics: 1;HE1PR0802MB2138;6:lwZEv65y8TuNE4ROrvLHgtd9KThJjwexnQtDyfgNOwD/VRQjbhd6u0hkIdanzMt3MDO38YpcP2nVeqxJQumiHZ575uMEfH5ZzIRdzFspoaE5qtPwfiBlwTcrdtQPeYvWhzn6CH2nNqUhOWE9ppY/q2QZGHwlJqdH8c4DsQ2AaWR+eqV80svnwsYoqHjQoYcWQsTcyu96cijb/zO4bavwLgZqwCXZKUwyKDnr5RVaaq3aj7rBnyb0zJQq0EzX+G8tbWJKOeg6deBKokDuO2aR1EWw+TqH8eeVab7hxCMw2RIDanTSD9WzEp4Y++mHKZ/rEXKZDykJxdibNfCQW7madshXGKN5JW7I6s3e+Sb9C2h5rjsJFUyrRWGVVjW7ArCC0xA0WzprqwDduGaPKkPVtBVAGvhGztV5rtLNq4PxBjXnEOhEMH0ymuRtpUz9x+SVlvDgDEFNTYbO5WFPmvoxFA==;5:2SN6qb9nAAlUx6wRjPDqhypWyHGwCYwoCuvDOA45k1gGNtREiwN5wcYJpaueFZWygJJ4jPbOnYj6IfHeEI/a9lMzX2RuytWTcaoXRX1XyTvINNO4arrEQwii+m+Q0buC/uqubnceZbLkqLhtwq+2vPf3t8lqovRGDjmTpJYYz+o=;24:VRxLguYioSOxwJloKqbeQPnb8hCLcDFOWl1L5a3EXpGUDRzmBnka5OxLGKqht29g2LCUBx5qsJVW6oLhIPIawecAzTZihREZOYPJO7ksaoU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0802MB2138;7:UhawUl2+YfsxldkQkBGLtfaEvzxDMMcj7w3jVcwbjK5nMRevfG4TyS9j8Ksi/1uwLTG5+n9Ln8AoExvso6rApP7fqeEkp/a81N3UFuEKERU9ORGz0p174LXkg89Vaw1ah6RU9sPerOlRf24Fu+U6LRveAHlZ6rHAIC1YpVIOmO7IbXtyz71uJ6RK8y8tvS3yY0bY2Oe1ZMwJLCtmnfMpFhSzAG/qbqsUxJumpHSPY5gAlDia0oL5HtyajYgVynZ9 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2018 14:33:51.9070 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e08bb8f1-b3b3-497a-7478-08d59ef014e9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0802MB2138 X-IsSubscribed: yes X-SW-Source: 2018-04/txt/msg00179.txt.bz2 V5 addresses Simon's review comments, mostly in the first two patches and the "Create xml..." patch. Added changes since previous verion in the patch headers. Series is slightly shorted as some early patches have been committed. Summary: For those targets that use new style target descriptions (also known as flexible target descriptions), this set of patches 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 register 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. Targets which use the older style target descriptions have not been changed. 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 1-3 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=all build with target boards unix and native-gdbserver. Also built and tested aarch64 and Arm32 (which uses old style descriptions) In addition, new test cases are added to the unit tests. Alan Hayward (8): Commonise tdesc_reg Commonise tdesc_feature Commonise tdesc types Add tdesc osabi and architecture functions Add feature reference in .dat files Create xml from target descriptions Remove xml file references from target descriptions. Remove xml files from gdbserver gdb/Makefile.in | 2 + gdb/common/tdesc.c | 400 ++++++++++++++ gdb/common/tdesc.h | 322 ++++++++++- gdb/features/Makefile | 6 + 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 | 28 - gdb/gdbserver/server.c | 2 +- gdb/gdbserver/tdesc.c | 182 ++----- gdb/gdbserver/tdesc.h | 19 +- gdb/regformats/aarch64.dat | 1 + gdb/regformats/i386/amd64-avx-avx512-linux.dat | 1 + gdb/regformats/i386/amd64-avx-linux.dat | 1 + .../i386/amd64-avx-mpx-avx512-pku-linux.dat | 1 + gdb/regformats/i386/amd64-avx-mpx-linux.dat | 1 + gdb/regformats/i386/amd64-linux.dat | 1 + gdb/regformats/i386/amd64-mpx-linux.dat | 1 + gdb/regformats/i386/amd64.dat | 1 + gdb/regformats/i386/i386-avx-avx512-linux.dat | 1 + gdb/regformats/i386/i386-avx-linux.dat | 1 + .../i386/i386-avx-mpx-avx512-pku-linux.dat | 1 + gdb/regformats/i386/i386-avx-mpx-linux.dat | 1 + gdb/regformats/i386/i386-linux.dat | 1 + gdb/regformats/i386/i386-mmx-linux.dat | 1 + gdb/regformats/i386/i386-mpx-linux.dat | 1 + gdb/regformats/i386/i386.dat | 1 + gdb/regformats/i386/x32-avx-avx512-linux.dat | 1 + gdb/regformats/i386/x32-avx-linux.dat | 1 + gdb/regformats/i386/x32-linux.dat | 1 + gdb/regformats/regdat.sh | 12 +- gdb/regformats/regdef.h | 8 +- gdb/regformats/tic6x-c62x-linux.dat | 1 + gdb/regformats/tic6x-c64x-linux.dat | 1 + gdb/regformats/tic6x-c64xp-linux.dat | 1 + gdb/target-descriptions.c | 604 +++------------------ gdb/target-descriptions.h | 8 - gdb/xml-tdesc.c | 11 + gdb/xml-tdesc.h | 5 + 58 files changed, 940 insertions(+), 736 deletions(-) create mode 100644 gdb/common/tdesc.c -- 2.14.3 (Apple Git-98)