From patchwork Thu Jul 9 11:22:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 7612 Received: (qmail 118044 invoked by alias); 9 Jul 2015 11:22:29 -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 118035 invoked by uid 89); 9 Jul 2015 11:22:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f181.google.com Received: from mail-pd0-f181.google.com (HELO mail-pd0-f181.google.com) (209.85.192.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 09 Jul 2015 11:22:27 +0000 Received: by pdjr16 with SMTP id r16so2686137pdj.3 for ; Thu, 09 Jul 2015 04:22:26 -0700 (PDT) X-Received: by 10.70.24.33 with SMTP id r1mr30710215pdf.74.1436440946192; Thu, 09 Jul 2015 04:22:26 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id nm9sm5663466pdb.26.2015.07.09.04.22.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Jul 2015 04:22:25 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] [gdbserver, aarch64] Set userregs to NULL in regs_info Date: Thu, 9 Jul 2015 12:22:20 +0100 Message-Id: <1436440940-11732-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Hi, I happen to read the comments in regs_info below, struct regs_info { ... /* Info used when accessing registers with PTRACE_PEEKUSER / PTRACE_POKEUSER. This can be NULL if all registers are transferred with regsets .*/ struct usrregs_info *usrregs; that usrregs can be NULL if all registers are transferred with regsets, which is exactly what aarch64-linux does. This patch is to set userregs to NULL in regs_info and remove aarch64_usrregs_info and aarch64_regmap. Regression tested on aarch64-linux with GDBserver. gdb/gdbserver: 2015-07-09 Yao Qi * linux-aarch64-low.c (aarch64_regmap): Remove. (aarch64_usrregs_info): Remove. (regs_info): Set field userregs to NULL. --- gdb/gdbserver/linux-aarch64-low.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 8a30b00..641b176 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -51,28 +51,6 @@ extern const struct target_desc *tdesc_aarch64; #define AARCH64_NUM_REGS (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 2) -static int -aarch64_regmap [] = -{ - /* These offsets correspond to GET/SETREGSET */ - /* x0... */ - 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8, - 16*8, 17*8, 18*8, 19*8, 20*8, 21*8, 22*8, 23*8, - 24*8, 25*8, 26*8, 27*8, 28*8, - 29*8, - 30*8, /* x30 lr */ - 31*8, /* x31 sp */ - 32*8, /* pc */ - 33*8, /* cpsr 4 bytes!*/ - - /* FP register offsets correspond to GET/SETFPREGSET */ - 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16, - 16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16, - 24*16, 25*16, 26*16, 27*16, 28*16, 29*16, 30*16, 31*16 -}; - /* Here starts the macro definitions, data structures, and code for the hardware breakpoint and hardware watchpoint support. The following is the abbreviations that are used frequently in the code @@ -1285,16 +1263,10 @@ static struct regsets_info aarch64_regsets_info = NULL, /* disabled_regsets */ }; -static struct usrregs_info aarch64_usrregs_info = - { - AARCH64_NUM_REGS, - aarch64_regmap, - }; - static struct regs_info regs_info = { NULL, /* regset_bitmap */ - &aarch64_usrregs_info, + NULL, /* usrregs */ &aarch64_regsets_info, };