From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@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:23:00 -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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00089.txt.bz2 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 .= */ >=20=20 > +/* 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 =3D arm_abi_breakpoint; > +#else > +static const unsigned long arm_breakpoint =3D arm_eabi_breakpoint; > +#endif > + > +#define arm_breakpoint_len 4 > +static const unsigned short thumb_breakpoint =3D 0xde01; > +#define thumb_breakpoint_len 2 > +static const unsigned short thumb2_breakpoint[] =3D { 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. --=20 Yao (=E9=BD=90=E5=B0=A7) =46rom 33ebce2938c38904e9a9710d51e40c4c94a79dfe Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Wed, 6 Jan 2016 12:11:41 +0000 Subject: [PATCH] [ARM/AArch64] Fix -Werror=3Dunused-const-variable warnings= in GDBserver This patch fixes gcc warning when build ARM GDBserver and AArch64 GDBserver, AArch64 GDBserver: gdb/gdbserver/linux-aarch32-low.h:36:29: error: 'thumb2_breakpoint' defined= but not used [-Werror=3Dunused-const-variable] static const unsigned short thumb2_breakpoint[] =3D { 0xf7f0, 0xa000 }; ^ gdb/gdbserver/linux-aarch32-low.h:34:29: error: 'thumb_breakpoint' defined = but not used [-Werror=3Dunused-const-variable] static const unsigned short thumb_breakpoint =3D 0xde01; ^ gdb/gdbserver/linux-aarch32-low.h:28:28: error: 'arm_breakpoint' defined bu= t not used [-Werror=3Dunused-const-variable] static const unsigned long arm_breakpoint =3D arm_eabi_breakpoint; ^ cc1: all warnings being treated as errors ARM GDBserver: gdb/gdbserver/linux-aarch32-low.h:34:29: error: 'thumb_breakpoint' defined = but not used [-Werror=3Dunused-const-variable] static const unsigned short thumb_breakpoint =3D 0xde01; ^~~~~~~~~~~~~~~~ gdb/gdbserver/linux-aarch32-low.h:28:28: error: 'arm_breakpoint' defined bu= t not used [-Werror=3Dunused-const-variable] static const unsigned long arm_breakpoint =3D arm_eabi_breakpoint; ^~~~~~~~~~~~~~ by simply moving these macros and variables to linux-aarch32-low.c and only declare thumb2_breakpoint in linux-aarch32-low.h, which is not perfect, and reveals some issues in recent arm GDBserver software single step changes. I'll post follow-up patches. gdb/gdbserver: 2016-01-06 Yao Qi * linux-aarch32-low.h (arm_abi_breakpoint): Move to linux-aarch32-low.c. (arm_eabi_breakpoint, arm_breakpoint): Likewise. (arm_breakpoint_len, thumb_breakpoint_len): Likewise. (thumb2_breakpoint, thumb2_breakpoint_len): Likewise. (thumb2_breakpoint): Declare. * linux-aarch32-low.c (arm_abi_breakpoint): Moved from linux-aarch32-low.h. (arm_eabi_breakpoint, arm_breakpoint): Likewise. (arm_breakpoint_len, thumb_breakpoint_len): Likewise. (thumb2_breakpoint, thumb2_breakpoint_len): Likewise. diff --git a/gdb/gdbserver/linux-aarch32-low.c b/gdb/gdbserver/linux-aarch3= 2-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 =20 +/* 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 =3D arm_eabi_breakpoint; +#else +static const unsigned long arm_breakpoint =3D arm_abi_breakpoint; +#endif + +#define arm_breakpoint_len 4 +static const unsigned short thumb_breakpoint =3D 0xde01; +#define thumb_breakpoint_len 2 +const unsigned short thumb2_breakpoint[] =3D { 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-aarch3= 2-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 . = */ =20 -/* 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 =3D arm_eabi_breakpoint; -#else -static const unsigned long arm_breakpoint =3D arm_abi_breakpoint; -#endif - -#define arm_breakpoint_len 4 -static const unsigned short thumb_breakpoint =3D 0xde01; -#define thumb_breakpoint_len 2 -static const unsigned short thumb2_breakpoint[] =3D { 0xf7f0, 0xa000 }; -#define thumb2_breakpoint_len 4 +extern const unsigned short thumb2_breakpoint[]; =20 extern struct regs_info regs_info_aarch32; =20