From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96403 invoked by alias); 11 May 2017 15:55:12 -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 94482 invoked by uid 89); 11 May 2017 15:55:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=ABC, varies, *c, AB X-HELO: mail-pg0-f44.google.com Received: from mail-pg0-f44.google.com (HELO mail-pg0-f44.google.com) (74.125.83.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 May 2017 15:55:08 +0000 Received: by mail-pg0-f44.google.com with SMTP id 64so16637015pgb.3 for ; Thu, 11 May 2017 08:55:10 -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:cc:subject:date:message-id; bh=50SaQnQeurxMPoyz/SoprZyblZ90Cj0gZshT2Bb8pjk=; b=bmlTgFO3bMbukpKzUxVvTk5qvyFmqpRSTLeq5LoSTw3s6zBmrNSCBzLfzPfQ5n0r3/ Wc+lRYCNk1vEh9VBWzP03XvlpbbiowzfseJiZtdBw/i1+/tMg3MttXXzukW0tqXHoZFG M2Z7Izgj6THLHwryNDmx/COgUk3d+JHt6dcVW2od7vFCvUskpOAm0MUZdM6Euv0VJMOp jqfmy3xOaQZiOpurYoONehFVj4gpGlNgA/xy7JuaCU5kSFQOkAI8vg1PNKpF06QiZpUi fhBQktPe7cQBxP2CyrtckGSUIDSKQ5vmRJYgdRp9OIbVo41grYYgPBWkBWRIa5baf2t8 QnSg== X-Gm-Message-State: AODbwcBehhzMAAAQZ+Rie1TxI48whbH774PuSpIZ+H/1YLKc21iyHy/g r5GC7jRtzx3puEoK X-Received: by 10.99.51.74 with SMTP id z71mr1049996pgz.137.1494518108958; Thu, 11 May 2017 08:55:08 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id f27sm1021158pga.41.2017.05.11.08.55.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 May 2017 08:55:08 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Cc: alan.hayward@arm.com Subject: [RFC 0/7] Make GDB builtin target descriptions more flexible Date: Thu, 11 May 2017 15:55:00 -0000 Message-Id: <1494518105-15412-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00291.txt.bz2 This patch series is to change GDB builtin target descriptions more flexible, by removing pre-generated ones. Instead, these builtin target descriptions can be got lazily and dynamically. GDB builtin target descriptions are created from initialize_tdesc_* functions in features/*.c files. This patch series demonstrate what does target descriptions look like by only touching i386-linux target descriptions. There are some shortcoming in GDB target description, 1) All builtin target descriptions are pre-defined. Since all GDB target descriptions are pre-defined, it is not flexible to compose features for different target descriptions. Suppose, some architecture has three hardware features (like avx or mpx in x86), A, B, and C. B and C can be optional. During to the current GDB target description limitation, we need to define four target descriptions A, A-B, A-C, A-B-C. If we need to add a new optional feature D, we need to double target descriptions. 2) Target feature is not parameterized. Registers in the same target feature may have different register sizes in different target descriptions. For example, the register size in "org.gnu.gdb.power.core" and "org.gnu.gdb.mips.cpu" varies between 32-bit variant and 64-bit variant. As a result, there are two xml files for the same feature respectively. Only 1) is addressed in this patch series for i386-linux target. If people like what this patch series does, I'll gradually change other target descriptions to the new style. That is why I post this RFC. GDBserver target description needs change as well, to make it more flexible too, but GDBserver changes can be independent with GDB changes, as long as the basic xml format is not changed. Patch 1 is to move mips target descriptions from -nat.c to -tdep.c, so that I can test them on x86_64-linux. I've posted it separately https://sourceware.org/ml/gdb-patches/2017-05/msg00204.html, include it here to give more context. Patch 2 adds a good unit test to verify we can get the same target description from both xml files and c files. It makes sure my following changes don't break anything on target descriptions, but it, as a unit test case, can go in independently. Patch 4 is the major part of this series, and the following patches changes i386-linux target descriptions, which become more flexible, so that we can compose these target features in a free way. Regression tested on x86_64-linux{-m32,-m64} and ppc64-linux. *** BLURB HERE *** Yao Qi (7): Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c Add unit test to builtin tdesc generated by xml Adjust the order of 32bit-linux.xml and 32bit-sse.xml in i386/i386-linux.xml Share code in initialize_tdesc_ functions Centralize i386 linux target descriptions Lazily and dynamically create i386-linux target descriptions Remove builtin tdesc_i386_*_linux gdb/features/aarch64.c | 184 ++++--- gdb/features/arc-arcompact.c | 119 +++-- gdb/features/arc-v2.c | 119 +++-- gdb/features/arm/arm-with-iwmmxt.c | 126 +++-- gdb/features/arm/arm-with-m-fpa-layout.c | 76 ++- gdb/features/arm/arm-with-m-vfp-d16.c | 106 ++-- gdb/features/arm/arm-with-m.c | 57 ++- gdb/features/arm/arm-with-neon.c | 153 ++++-- gdb/features/arm/arm-with-vfpv2.c | 106 ++-- gdb/features/arm/arm-with-vfpv3.c | 138 +++-- gdb/features/i386/amd64-avx-avx512-linux.c | 403 +++++++++------ gdb/features/i386/amd64-avx-avx512.c | 366 +++++++------ gdb/features/i386/amd64-avx-linux.c | 244 ++++++--- gdb/features/i386/amd64-avx-mpx-avx512-pku-linux.c | 445 ++++++++++------ gdb/features/i386/amd64-avx-mpx-avx512-pku.c | 408 +++++++++------ gdb/features/i386/amd64-avx-mpx-linux.c | 271 ++++++---- gdb/features/i386/amd64-avx-mpx.c | 234 +++++---- gdb/features/i386/amd64-avx.c | 207 +++++--- gdb/features/i386/amd64-linux.c | 199 ++++--- gdb/features/i386/amd64-mpx-linux.c | 226 +++++--- gdb/features/i386/amd64-mpx.c | 189 ++++--- gdb/features/i386/amd64.c | 162 +++--- gdb/features/i386/i386-avx-avx512-linux.c | 213 +++++--- gdb/features/i386/i386-avx-avx512.c | 205 +++++--- gdb/features/i386/i386-avx-linux.c | 168 +++--- gdb/features/i386/i386-avx-mpx-avx512-pku-linux.c | 251 ++++++--- gdb/features/i386/i386-avx-mpx-avx512-pku.c | 247 ++++++--- gdb/features/i386/i386-avx-mpx-linux.c | 192 ++++--- gdb/features/i386/i386-avx-mpx.c | 186 ++++--- gdb/features/i386/i386-avx.c | 159 ++++-- gdb/features/i386/i386-linux.c | 142 +++-- gdb/features/i386/i386-linux.xml | 2 +- gdb/features/i386/i386-mmx-linux.c | 105 ++-- gdb/features/i386/i386-mmx.c | 96 ++-- gdb/features/i386/i386-mpx-linux.c | 164 +++--- gdb/features/i386/i386-mpx.c | 157 ++++-- gdb/features/i386/i386.c | 130 +++-- gdb/features/i386/x32-avx-avx512-linux.c | 403 +++++++++------ gdb/features/i386/x32-avx-avx512.c | 366 +++++++------ gdb/features/i386/x32-avx-linux.c | 244 ++++++--- gdb/features/i386/x32-avx.c | 207 +++++--- gdb/features/i386/x32-linux.c | 199 ++++--- gdb/features/i386/x32.c | 162 +++--- gdb/features/microblaze-with-stack-protect.c | 155 +++--- gdb/features/microblaze.c | 136 ++--- gdb/features/mips-dsp-linux.c | 258 ++++++---- gdb/features/mips-linux.c | 224 +++++--- gdb/features/mips64-dsp-linux.c | 256 +++++---- gdb/features/mips64-linux.c | 222 +++++--- gdb/features/nds32.c | 190 ++++--- gdb/features/nios2-linux.c | 120 +++-- gdb/features/nios2.c | 120 +++-- gdb/features/rs6000/powerpc-32.c | 182 ++++--- gdb/features/rs6000/powerpc-32l.c | 204 +++++--- gdb/features/rs6000/powerpc-403.c | 355 +++++++------ gdb/features/rs6000/powerpc-403gc.c | 367 +++++++------ gdb/features/rs6000/powerpc-405.c | 290 ++++++----- gdb/features/rs6000/powerpc-505.c | 313 ++++++----- gdb/features/rs6000/powerpc-601.c | 324 +++++++----- gdb/features/rs6000/powerpc-602.c | 328 +++++++----- gdb/features/rs6000/powerpc-603.c | 328 +++++++----- gdb/features/rs6000/powerpc-604.c | 327 +++++++----- gdb/features/rs6000/powerpc-64.c | 182 ++++--- gdb/features/rs6000/powerpc-64l.c | 204 +++++--- gdb/features/rs6000/powerpc-7400.c | 379 ++++++++------ gdb/features/rs6000/powerpc-750.c | 354 +++++++------ gdb/features/rs6000/powerpc-860.c | 401 +++++++++------ gdb/features/rs6000/powerpc-altivec32.c | 273 ++++++---- gdb/features/rs6000/powerpc-altivec32l.c | 291 ++++++----- gdb/features/rs6000/powerpc-altivec64.c | 273 ++++++---- gdb/features/rs6000/powerpc-altivec64l.c | 291 ++++++----- gdb/features/rs6000/powerpc-cell32l.c | 293 ++++++----- gdb/features/rs6000/powerpc-cell64l.c | 293 ++++++----- gdb/features/rs6000/powerpc-e500.c | 184 ++++--- gdb/features/rs6000/powerpc-e500l.c | 206 +++++--- gdb/features/rs6000/powerpc-isa205-32l.c | 204 +++++--- gdb/features/rs6000/powerpc-isa205-64l.c | 204 +++++--- gdb/features/rs6000/powerpc-isa205-altivec32l.c | 291 ++++++----- gdb/features/rs6000/powerpc-isa205-altivec64l.c | 291 ++++++----- gdb/features/rs6000/powerpc-isa205-vsx32l.c | 368 +++++++------ gdb/features/rs6000/powerpc-isa205-vsx64l.c | 368 +++++++------ gdb/features/rs6000/powerpc-vsx32.c | 350 +++++++------ gdb/features/rs6000/powerpc-vsx32l.c | 368 +++++++------ gdb/features/rs6000/powerpc-vsx64.c | 350 +++++++------ gdb/features/rs6000/powerpc-vsx64l.c | 368 +++++++------ gdb/features/rs6000/rs6000.c | 184 ++++--- gdb/features/s390-linux32.c | 173 ++++--- gdb/features/s390-linux32v1.c | 175 ++++--- gdb/features/s390-linux32v2.c | 177 ++++--- gdb/features/s390-linux64.c | 205 +++++--- gdb/features/s390-linux64v1.c | 207 +++++--- gdb/features/s390-linux64v2.c | 209 +++++--- gdb/features/s390-te-linux64.c | 262 ++++++---- gdb/features/s390-tevx-linux64.c | 343 ++++++++----- gdb/features/s390-vx-linux64.c | 290 +++++++---- gdb/features/s390x-linux64.c | 173 ++++--- gdb/features/s390x-linux64v1.c | 175 ++++--- gdb/features/s390x-linux64v2.c | 177 ++++--- gdb/features/s390x-te-linux64.c | 230 ++++++--- gdb/features/s390x-tevx-linux64.c | 311 ++++++----- gdb/features/s390x-vx-linux64.c | 258 ++++++---- gdb/features/tic6x-c62x-linux.c | 90 ++-- gdb/features/tic6x-c62x.c | 90 ++-- gdb/features/tic6x-c64x-linux.c | 169 +++--- gdb/features/tic6x-c64x.c | 169 +++--- gdb/features/tic6x-c64xp-linux.c | 192 ++++--- gdb/features/tic6x-c64xp.c | 192 ++++--- gdb/i386-linux-tdep.c | 103 +++- gdb/i386-linux-tdep.h | 10 +- gdb/mips-linux-nat.c | 11 - gdb/mips-linux-tdep.c | 11 + gdb/mips-linux-tdep.h | 6 + gdb/target-descriptions.c | 570 ++++++++++++++++++--- gdb/target-descriptions.h | 20 + gdb/testsuite/gdb.xml/maint_print_struct.exp | 4 +- gdb/x86-linux-nat.c | 24 +- gdb/xml-tdesc.c | 7 +- 117 files changed, 15741 insertions(+), 9497 deletions(-) -- 1.9.1