From patchwork Fri Dec 11 11:18:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 9973 Received: (qmail 540 invoked by alias); 11 Dec 2015 11:18:49 -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 495 invoked by uid 89); 11 Dec 2015 11:18:48 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f41.google.com Received: from mail-pa0-f41.google.com (HELO mail-pa0-f41.google.com) (209.85.220.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 11 Dec 2015 11:18:47 +0000 Received: by padhk6 with SMTP id hk6so24200860pad.2 for ; Fri, 11 Dec 2015 03:18:45 -0800 (PST) X-Received: by 10.66.227.1 with SMTP id rw1mr24436756pac.35.1449832725457; Fri, 11 Dec 2015 03:18:45 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id r5sm24564964pfi.73.2015.12.11.03.18.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Dec 2015 03:18:44 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Use arm_eabi_breakpoint on aarch32 Date: Fri, 11 Dec 2015 11:18:39 +0000 Message-Id: <1449832719-17721-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes Nowdays, GDBserver chooses arm breakpoint instructions by checking macro __ARM_EABI__. When aarch64 GDBserver debugs arm program, arm_eabi_breakpoint is still needed, but __ARM_EABI__ isn't defined in aarch64 compiler. This causes GDBserver chooses the wrong breakpoint instruction for arm program. This patch fixes it. I'll push it in. gdb/gdbserver: 2015-12-11 Yao Qi * linux-aarch32-low.c [__aarch64__]: Use arm_abi_breakpoint arm breakpoint. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/linux-aarch32-low.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 7f7b6c1..d8a817f 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2015-12-11 Yao Qi + + * linux-aarch32-low.c [__aarch64__]: Use arm_abi_breakpoint + arm breakpoint. + 2015-12-07 Yao Qi * configure.srv: Append arm.o to srv_tgtobj for diff --git a/gdb/gdbserver/linux-aarch32-low.c b/gdb/gdbserver/linux-aarch32-low.c index 7379350..930e73a 100644 --- a/gdb/gdbserver/linux-aarch32-low.c +++ b/gdb/gdbserver/linux-aarch32-low.c @@ -146,10 +146,10 @@ struct regs_info regs_info_aarch32 = ABI's breakpoint instruction. For now at least. */ #define arm_eabi_breakpoint 0xe7f001f0UL -#ifndef __ARM_EABI__ -static const unsigned long arm_breakpoint = arm_abi_breakpoint; -#else +#if (defined __ARM_EABI__ || defined __aarch64__) static const unsigned long arm_breakpoint = arm_eabi_breakpoint; +#else +static const unsigned long arm_breakpoint = arm_abi_breakpoint; #endif #define arm_breakpoint_len 4