From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84431 invoked by alias); 19 Dec 2018 06:13:55 -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 84408 invoked by uid 89); 19 Dec 2018 06:13:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-22.9 required=5.0 tests=BAYES_00,BODY_8BITS,GARBLED_BODY,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2361, 8:=d0=b4, 8:=d0=b5, 8:=d0=bb?= X-HELO: server28.superhosting.bg Received: from server28.superhosting.bg (HELO server28.superhosting.bg) (217.174.156.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 19 Dec 2018 06:13:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dinux.eu; s=default; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=SXpIBqQ+U8WOcRCe1/GpdKGg1kySKae0iex/uhPNlJY=; b=t1fLf/GCFvmT8WwctJlBlLDkqP rPdwIcpN7gRuoB/210XtiMky+IdXwS6K48odlh2ahYSDdb5BdgPF8Ja6Hp5MEvaCMH86VnXHyOYlD 9amoH+zeD6uu7DdcgEFmWpNVKO57aDtixJoDY6c8FoKbWM7V4ZLeWw+21Pd/ueqZmvHjeYs6xWPIe T1VEfW+ZpzFJVTbvhFdEBCms6xNbJZTb8PyHyYsrAgUCRZamA5BKAkMnjL5ybQ0j47Q5+rZhfLIWc 8M8GCHPRfbSyAxC/Kbl5dA/JplAXnSNMZJDcgQBGTsO5yTNbv8CUCydj2YzNgvGWe6GCGTL7yYZtC iREE44fw==; Received: from [95.87.234.74] (port=49446 helo=tpdeb.localnet) by server28.superhosting.bg with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gZV73-000Cfj-GS; Wed, 19 Dec 2018 08:13:48 +0200 From: Dimitar Dimitrov To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix build with latest GCC 9.0 tree Date: Wed, 19 Dec 2018 06:13:00 -0000 Message-ID: <67190652.4FIyeS7z2X@tpdeb> User-Agent: KMail/5.2.3 (Linux/4.9.0-8-amd64; KDE/5.28.0; x86_64; ; ) In-Reply-To: References: <20181217193052.24157-1-dimitar@dinux.eu> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-OutGoing-Spam-Status: No, score=-1.0 X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00219.txt.bz2 On =D0=BF=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D0=BD=D0=B8=D0=BA, 17 =D0=B4= =D0=B5=D0=BA=D0=B5=D0=BC=D0=B2=D1=80=D0=B8 2018 =D0=B3. 22:05:11 EET Simon = Marchi wrote: > On 2018-12-17 14:30, Dimitar Dimitrov wrote: > > A recent patch [1] to fix a GCC PR [2] actually broke the GDB build. > > To fix, remove the stack pointer clobber. GCC will ignore the clobber > > marker, and will not save or restore the stack pointer. > >=20 > > I ran "make check-gdb" on x86_64 to ensure there are no regressions. > >=20 > > gdb/ChangeLog: > >=20 > > 2018-12-17 Dimitar Dimitrov > >=20 > > * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Remove sp > >=20 > > clobbers. > >=20 > > [1] https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00532.html > > [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D52813 > >=20 > > Signed-off-by: Dimitar Dimitrov > > --- > >=20 > > gdb/nat/linux-ptrace.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > >=20 > > diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c > > index 1f21ef03a3..58aed199bf 100644 > > --- a/gdb/nat/linux-ptrace.c > > +++ b/gdb/nat/linux-ptrace.c > > @@ -128,14 +128,14 @@ linux_ptrace_test_ret_to_nx (void) > >=20 > > ".globl linux_ptrace_test_ret_to_nx_instr;" > > "linux_ptrace_test_ret_to_nx_instr:" > > "ret" > >=20 > > - : : "r" (return_address) : "%esp", "memory"); > > + : : "r" (return_address) : "memory"); > >=20 > > #elif defined __x86_64__ > >=20=20 > > asm volatile ("pushq %0;" > >=20=20=09=20=20 > > ".globl linux_ptrace_test_ret_to_nx_instr;" > > "linux_ptrace_test_ret_to_nx_instr:" > > "ret" > >=20=20=09=09=09 > > : : "r" ((uint64_t) (uintptr_t) return_address) > >=20 > > - : "%rsp", "memory"); > > + : "memory"); > >=20 > > #else > > # error "!__i386__ && !__x86_64__" > > #endif >=20 > LGTM: >=20 > 1. We push a return address and ret, so in the end the stack point has > not changed. > 2. This is executed in a child process, which immediately stops on a > breakpoint and never continues, even if the stack pointer was messed up, > we wouldn't notice. >=20 > Do you have push access, or would you like me to push the patch for you? I do not have push access for GDB. Please push it for me. Please note that discussion on GCC mailing list is still ongoing. I still=20 think that this GDB patch should be merged, though. https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01250.html https://gcc.gnu.org/ml/gcc-patches/2018-12/msg01308.html Thanks, Dimitar