From patchwork Fri Dec 11 11:19:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 9974 Received: (qmail 7393 invoked by alias); 11 Dec 2015 11:19:16 -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 7374 invoked by uid 89); 11 Dec 2015 11:19:15 -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-pf0-f173.google.com Received: from mail-pf0-f173.google.com (HELO mail-pf0-f173.google.com) (209.85.192.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 11 Dec 2015 11:19:14 +0000 Received: by pfnn128 with SMTP id n128so64939865pfn.0 for ; Fri, 11 Dec 2015 03:19:12 -0800 (PST) X-Received: by 10.98.14.155 with SMTP id 27mr14417772pfo.92.1449832752623; Fri, 11 Dec 2015 03:19:12 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id n73sm8545290pfi.29.2015.12.11.03.19.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Dec 2015 03:19:12 -0800 (PST) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Understand arm breakpoints in aarch64_breakpoint_at Date: Fri, 11 Dec 2015 11:19:06 +0000 Message-Id: <1449832746-17792-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes AArch64 GDBserver can debug ARM program, and it should recognize various arm breakpoint instructions. This patch should be included in 17b1509a. I'll pushed it in. gdb/gdbserver: 2015-12-11 Yao Qi * linux-aarch64-low.c (aarch64_breakpoint_at): Call arm_breakpoint_at if the process is 32-bit. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/linux-aarch64-low.c | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index d8a817f..617c249 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,10 @@ 2015-12-11 Yao Qi + * linux-aarch64-low.c (aarch64_breakpoint_at): Call + arm_breakpoint_at if the process is 32-bit. + +2015-12-11 Yao Qi + * linux-aarch32-low.c [__aarch64__]: Use arm_abi_breakpoint arm breakpoint. diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 5fd3f51..b4eb36b 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -211,14 +211,19 @@ static const gdb_byte aarch64_breakpoint[] = {0x00, 0x00, 0x20, 0xd4}; static int aarch64_breakpoint_at (CORE_ADDR where) { - gdb_byte insn[aarch64_breakpoint_len]; + if (is_64bit_tdesc ()) + { + gdb_byte insn[aarch64_breakpoint_len]; - (*the_target->read_memory) (where, (unsigned char *) &insn, - aarch64_breakpoint_len); - if (memcmp (insn, aarch64_breakpoint, aarch64_breakpoint_len) == 0) - return 1; + (*the_target->read_memory) (where, (unsigned char *) &insn, + aarch64_breakpoint_len); + if (memcmp (insn, aarch64_breakpoint, aarch64_breakpoint_len) == 0) + return 1; - return 0; + return 0; + } + else + return arm_breakpoint_at (where); } static void