From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126182 invoked by alias); 21 Aug 2017 15:29:19 -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 126159 invoked by uid 89); 21 Aug 2017 15:29:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=nowadays X-HELO: mail-io0-f172.google.com Received: from mail-io0-f172.google.com (HELO mail-io0-f172.google.com) (209.85.223.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Aug 2017 15:29:16 +0000 Received: by mail-io0-f172.google.com with SMTP id g71so53174325ioe.5 for ; Mon, 21 Aug 2017 08:29:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=ZzbBih+pzqZVE5I/zVUunQVSQWXPigl5Ha9cJD5AVDE=; b=JO+cdQ8erp5YiKWm25R3zojXqWU1Tt5GhJ4mF9EP6e83wIxxr32ZgSrlyHemwXcDsB b9poHhAbmAynJV4o1YKSH+t2uZDk+REH6mnnZxxxaO8REX2UAVVKXan2FW+DY93aMu5a cqaDHLBu1FwD639H1xKkQO59/nNLNBso4qTGzwZaC4/IIYG3mpUGlJeD4C4wZ8QYKOO/ I1Z4SIAyY9dF1Dc4AyBqrAi2/MY9S/cMnVsmO2XszE7XmK880QYRPGK/Jb16zHa6HOIp KJDHFRP8ONjtm/SRgM0qjV25FjkRgNTGI5czGSYimaqzzbW6E/UrTDbSx/6Q2yTNkml2 9l0A== X-Gm-Message-State: AHYfb5iqwrV1jNd8UqZs1loPaCKihYNU3qRiGMWnjxV74rXcUDaCNz+t 4WVoGl9qWQ/iEc6M X-Received: by 10.107.188.197 with SMTP id m188mr15790868iof.239.1503329353902; Mon, 21 Aug 2017 08:29:13 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id p62sm5831589ioe.34.2017.08.21.08.29.12 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 08:29:13 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 00/22 v4] Make GDB builtin target descriptions more flexible Date: Mon, 21 Aug 2017 15:29:00 -0000 Message-Id: <1503329347-26711-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00380.txt.bz2 This patch series is to change GDB and GDBserver builtin target descriptions more flexible, by removing pre-generated ones. Nowadays, GDB builtin target descriptions are created from initialize_tdesc_* functions in features/*.c files, while GDBserver builtin target descriptions are generated from regformats/*.dat files. Instead, with these patches applied, these builtin target descriptions can be got lazily and dynamically. This patch series changes both GDB and GDBserver to create target description dynamically from features, instead of using pre-generated target descriptions. This patch series only convert x86 target descriptions to demonstrate the usefulness of the change. Once one target architecture switches to the new flexible target description, - We only need xml feature files under gdb/features directory. All existing target description xml files can be kept for tests. Add new xml feature file if we want to support the new feature, but don't need to add new target description xml files. - All existing gdb/regformats/*.dat are not used, but kept for the tests. This is the v4, and v3 can be found https://sourceware.org/ml/gdb-patches/2017-07/msg00076.html v3 changes only x86-linux target descriptions, while v4 changes the whole x86 target descriptions. The rest of patches aren't changed since v3. The first four patches are new in v4, which is about getting target descriptions via {i386,amd64}_target_description. I pushed my branch to users/qiyao/target-desc-4 *** BLURB HERE *** Yao Qi (22): Use amd64_target_description to get tdesc_amd64 Use i386_target_description to get tdesc_i386 Return X86_XSTATE_SSE_MASK instead of 0 in i386fbsd_core_read_xcr0 Let i386_target_description return tdesc_i386_mmx Adjust code generated by regformats/regdat.sh Use VEC for target_desc.reg_defs Return X86_TDESC_MMX in x86_get_ipa_tdesc_idx [GDBserver] Centralize tdesc for i386-linux [GDBserver] unit test to i386_tdesc Dynamically composite xml in reply to GDB Share i386-linux target description between GDB and GDBserver Remove features/i386/i386-*linux.c [GDBserver] Use pre-generated tdesc as test [GDBserver] Shorten srv_i386_linux_xmlfiles Update comments in amd64_linux_core_read_description Centralize amd64-linux target descriptions Lazily and dynamically create amd64-linux target descriptions Convert amd64-linux target descriptions [GDBserver] Use pre-generated amd64-linux tdesc as test [GDBserver] Shorten srv_amd64_linux_xmlfiles Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.c Convert the rest x86 target descriptions gdb/Makefile.in | 4 + gdb/amd64-darwin-tdep.c | 4 +- gdb/amd64-dicos-tdep.c | 4 +- gdb/amd64-fbsd-nat.c | 4 +- gdb/amd64-fbsd-tdep.c | 3 +- gdb/amd64-linux-tdep.c | 124 ++++---- gdb/amd64-linux-tdep.h | 6 + gdb/amd64-nbsd-tdep.c | 4 +- gdb/amd64-obsd-tdep.c | 4 +- gdb/amd64-sol2-tdep.c | 4 +- gdb/amd64-tdep.c | 66 +++-- gdb/amd64-tdep.h | 2 - gdb/amd64-windows-tdep.c | 4 +- gdb/arch/amd64.c | 74 +++++ gdb/arch/amd64.h | 22 ++ gdb/arch/i386.c | 68 +++++ gdb/arch/i386.h | 21 ++ gdb/arch/tdesc.h | 92 ++++++ gdb/configure.tgt | 63 ++-- gdb/features/Makefile | 40 +-- gdb/features/i386/32bit-avx.c | 4 +- gdb/features/i386/32bit-avx512.c | 4 +- gdb/features/i386/32bit-core.c | 4 +- gdb/features/i386/32bit-linux.c | 4 +- gdb/features/i386/32bit-mpx.c | 4 +- gdb/features/i386/32bit-pkeys.c | 4 +- gdb/features/i386/32bit-sse.c | 4 +- gdb/features/i386/64bit-avx.c | 29 ++ gdb/features/i386/64bit-avx512.c | 124 ++++++++ gdb/features/i386/64bit-core.c | 74 +++++ gdb/features/i386/64bit-linux.c | 15 + gdb/features/i386/64bit-mpx.c | 51 ++++ gdb/features/i386/64bit-pkeys.c | 14 + gdb/features/i386/64bit-segments.c | 15 + gdb/features/i386/64bit-sse.c | 83 ++++++ gdb/features/i386/amd64-avx-avx512-linux.c | 288 ------------------ gdb/features/i386/amd64-avx-avx512.c | 283 ------------------ gdb/features/i386/amd64-avx-linux.c | 177 ----------- gdb/features/i386/amd64-avx-mpx-avx512-pku-linux.c | 329 --------------------- gdb/features/i386/amd64-avx-mpx-avx512-pku.c | 324 -------------------- gdb/features/i386/amd64-avx-mpx-linux.c | 215 -------------- gdb/features/i386/amd64-avx-mpx.c | 210 ------------- gdb/features/i386/amd64-avx.c | 172 ----------- gdb/features/i386/amd64-linux.c | 159 ---------- gdb/features/i386/amd64-mpx-linux.c | 197 ------------ gdb/features/i386/amd64-mpx.c | 192 ------------ gdb/features/i386/amd64.c | 154 ---------- gdb/features/i386/i386-avx-avx512-linux.c | 170 ----------- gdb/features/i386/i386-avx-avx512.c | 165 ----------- gdb/features/i386/i386-avx-linux.c | 149 ---------- gdb/features/i386/i386-avx-mpx-avx512-pku-linux.c | 211 ------------- gdb/features/i386/i386-avx-mpx-avx512-pku.c | 206 ------------- gdb/features/i386/i386-avx-mpx-linux.c | 187 ------------ gdb/features/i386/i386-avx-mpx.c | 182 ------------ gdb/features/i386/i386-avx.c | 144 --------- gdb/features/i386/i386-linux.c | 139 --------- gdb/features/i386/i386-mmx-linux.c | 78 ----- gdb/features/i386/i386-mmx.c | 73 ----- gdb/features/i386/i386-mpx-linux.c | 177 ----------- gdb/features/i386/i386-mpx.c | 172 ----------- gdb/features/i386/i386.c | 134 --------- gdb/features/i386/x32-avx-avx512-linux.c | 288 ------------------ gdb/features/i386/x32-avx-linux.c | 177 ----------- gdb/features/i386/x32-core.c | 74 +++++ gdb/features/i386/x32-linux.c | 159 ---------- gdb/gdbserver/Makefile.in | 13 + gdb/gdbserver/configure.srv | 55 ++-- gdb/gdbserver/linux-amd64-ipa.c | 56 ++-- gdb/gdbserver/linux-i386-ipa.c | 39 +-- gdb/gdbserver/linux-x86-low.c | 146 ++------- gdb/gdbserver/linux-x86-tdesc-selftest.c | 183 ++++++++++++ gdb/gdbserver/linux-x86-tdesc.c | 173 +++++++++++ gdb/gdbserver/linux-x86-tdesc.h | 78 +---- gdb/gdbserver/lynx-i386-low.c | 9 +- gdb/gdbserver/nto-x86-low.c | 11 +- gdb/gdbserver/regcache.c | 34 ++- gdb/gdbserver/server.c | 10 +- gdb/gdbserver/tdesc.c | 186 +++++++++++- gdb/gdbserver/tdesc.h | 106 ++++++- gdb/gdbserver/win32-i386-low.c | 22 +- gdb/i386-fbsd-nat.c | 10 +- gdb/i386-fbsd-tdep.c | 4 +- gdb/i386-go32-tdep.c | 3 +- gdb/i386-linux-tdep.c | 37 +-- gdb/i386-tdep.c | 73 +++-- gdb/i386-tdep.h | 3 - gdb/regformats/regdat.sh | 26 +- gdb/regformats/regdef.h | 12 + gdb/target-descriptions.c | 62 ++-- gdb/target-descriptions.h | 37 +-- gdb/x86-linux-nat.c | 35 +-- 91 files changed, 1858 insertions(+), 6196 deletions(-) create mode 100644 gdb/arch/amd64.c create mode 100644 gdb/arch/amd64.h create mode 100644 gdb/arch/i386.c create mode 100644 gdb/arch/i386.h create mode 100644 gdb/arch/tdesc.h create mode 100644 gdb/features/i386/64bit-avx.c create mode 100644 gdb/features/i386/64bit-avx512.c create mode 100644 gdb/features/i386/64bit-core.c create mode 100644 gdb/features/i386/64bit-linux.c create mode 100644 gdb/features/i386/64bit-mpx.c create mode 100644 gdb/features/i386/64bit-pkeys.c create mode 100644 gdb/features/i386/64bit-segments.c create mode 100644 gdb/features/i386/64bit-sse.c delete mode 100644 gdb/features/i386/amd64-avx-avx512-linux.c delete mode 100644 gdb/features/i386/amd64-avx-avx512.c delete mode 100644 gdb/features/i386/amd64-avx-linux.c delete mode 100644 gdb/features/i386/amd64-avx-mpx-avx512-pku-linux.c delete mode 100644 gdb/features/i386/amd64-avx-mpx-avx512-pku.c delete mode 100644 gdb/features/i386/amd64-avx-mpx-linux.c delete mode 100644 gdb/features/i386/amd64-avx-mpx.c delete mode 100644 gdb/features/i386/amd64-avx.c delete mode 100644 gdb/features/i386/amd64-linux.c delete mode 100644 gdb/features/i386/amd64-mpx-linux.c delete mode 100644 gdb/features/i386/amd64-mpx.c delete mode 100644 gdb/features/i386/amd64.c delete mode 100644 gdb/features/i386/i386-avx-avx512-linux.c delete mode 100644 gdb/features/i386/i386-avx-avx512.c delete mode 100644 gdb/features/i386/i386-avx-linux.c delete mode 100644 gdb/features/i386/i386-avx-mpx-avx512-pku-linux.c delete mode 100644 gdb/features/i386/i386-avx-mpx-avx512-pku.c delete mode 100644 gdb/features/i386/i386-avx-mpx-linux.c delete mode 100644 gdb/features/i386/i386-avx-mpx.c delete mode 100644 gdb/features/i386/i386-avx.c delete mode 100644 gdb/features/i386/i386-linux.c delete mode 100644 gdb/features/i386/i386-mmx-linux.c delete mode 100644 gdb/features/i386/i386-mmx.c delete mode 100644 gdb/features/i386/i386-mpx-linux.c delete mode 100644 gdb/features/i386/i386-mpx.c delete mode 100644 gdb/features/i386/i386.c delete mode 100644 gdb/features/i386/x32-avx-avx512-linux.c delete mode 100644 gdb/features/i386/x32-avx-linux.c create mode 100644 gdb/features/i386/x32-core.c delete mode 100644 gdb/features/i386/x32-linux.c create mode 100644 gdb/gdbserver/linux-x86-tdesc-selftest.c create mode 100644 gdb/gdbserver/linux-x86-tdesc.c -- 1.9.1