From patchwork Wed Jan 6 14:22:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 10251 Received: (qmail 90762 invoked by alias); 6 Jan 2016 14:23:04 -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 90750 invoked by uid 89); 6 Jan 2016 14:23:03 -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 spammy=2727, 156, perfect X-HELO: mail-pf0-f182.google.com Received: from mail-pf0-f182.google.com (HELO mail-pf0-f182.google.com) (209.85.192.182) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 06 Jan 2016 14:23:02 +0000 Received: by mail-pf0-f182.google.com with SMTP id q63so203800825pfb.0 for ; Wed, 06 Jan 2016 06:23:02 -0800 (PST) X-Received: by 10.98.69.73 with SMTP id s70mr142019492pfa.4.1452090180414; Wed, 06 Jan 2016 06:23:00 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id p83sm135975103pfi.96.2016.01.06.06.22.56 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 06 Jan 2016 06:22:59 -0800 (PST) From: Yao Qi To: Antoine Tremblay Cc: Subject: Re: [PATCH v8 5/7] Support software single step on ARM in GDBServer References: <1450361684-29536-1-git-send-email-antoine.tremblay@ericsson.com> <1450361684-29536-6-git-send-email-antoine.tremblay@ericsson.com> Date: Wed, 06 Jan 2016 14:22:54 +0000 In-Reply-To: <1450361684-29536-6-git-send-email-antoine.tremblay@ericsson.com> (Antoine Tremblay's message of "Thu, 17 Dec 2015 09:14:42 -0500") Message-ID: <86a8oiyegx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Antoine Tremblay writes: Hi Antoine, > --- a/gdb/gdbserver/linux-aarch32-low.h > +++ b/gdb/gdbserver/linux-aarch32-low.h > @@ -15,6 +15,27 @@ > You should have received a copy of the GNU General Public License > along with this program. If not, see . */ > > +/* Correct in either endianness. */ > +#define arm_abi_breakpoint 0xef9f0001UL > + > +/* For new EABI binaries. We recognize it regardless of which ABI > + is used for gdbserver, so single threaded debugging should work > + OK, but for multi-threaded debugging we only insert the current > + 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 > +static const unsigned long arm_breakpoint = arm_eabi_breakpoint; > +#endif > + > +#define arm_breakpoint_len 4 > +static const unsigned short thumb_breakpoint = 0xde01; > +#define thumb_breakpoint_len 2 > +static const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 }; > +#define thumb2_breakpoint_len 4 > + This change causes GDBserver build errors on both ARM and AArch64, which are shown in the commit log of the patch below. diff --git a/gdb/gdbserver/linux-aarch32-low.c b/gdb/gdbserver/linux-aarch32-low.c index 74deca3..ed66e08 100644 --- a/gdb/gdbserver/linux-aarch32-low.c +++ b/gdb/gdbserver/linux-aarch32-low.c @@ -27,6 +27,27 @@ #include #endif +/* Correct in either endianness. */ +#define arm_abi_breakpoint 0xef9f0001UL + +/* For new EABI binaries. We recognize it regardless of which ABI + is used for gdbserver, so single threaded debugging should work + OK, but for multi-threaded debugging we only insert the current + ABI's breakpoint instruction. For now at least. */ +#define arm_eabi_breakpoint 0xe7f001f0UL + +#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 +static const unsigned short thumb_breakpoint = 0xde01; +#define thumb_breakpoint_len 2 +const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 }; +#define thumb2_breakpoint_len 4 + /* Some older versions of GNU/Linux and Android do not define the following macros. */ #ifndef NT_ARM_VFP diff --git a/gdb/gdbserver/linux-aarch32-low.h b/gdb/gdbserver/linux-aarch32-low.h index c8f6646..5c68454 100644 --- a/gdb/gdbserver/linux-aarch32-low.h +++ b/gdb/gdbserver/linux-aarch32-low.h @@ -15,26 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -/* Correct in either endianness. */ -#define arm_abi_breakpoint 0xef9f0001UL - -/* For new EABI binaries. We recognize it regardless of which ABI - is used for gdbserver, so single threaded debugging should work - OK, but for multi-threaded debugging we only insert the current - ABI's breakpoint instruction. For now at least. */ -#define arm_eabi_breakpoint 0xe7f001f0UL - -#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 -static const unsigned short thumb_breakpoint = 0xde01; -#define thumb_breakpoint_len 2 -static const unsigned short thumb2_breakpoint[] = { 0xf7f0, 0xa000 }; -#define thumb2_breakpoint_len 4 +extern const unsigned short thumb2_breakpoint[]; extern struct regs_info regs_info_aarch32;