From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76358 invoked by alias); 18 Dec 2018 03:05:22 -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 76345 invoked by uid 89); 18 Dec 2018 03:05:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=H*UA:Roundcube, H*u:Roundcube, H*u:1.3.6, H*UA:1.3.6 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Dec 2018 03:05:19 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id wBI35DJO009582 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 17 Dec 2018 22:05:18 -0500 Received: by simark.ca (Postfix, from userid 112) id 691A91E7B1; Mon, 17 Dec 2018 22:05:13 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 075421E4C0; Mon, 17 Dec 2018 22:05:12 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 18 Dec 2018 03:05:00 -0000 From: Simon Marchi To: Dimitar Dimitrov Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix build with latest GCC 9.0 tree In-Reply-To: <20181217193052.24157-1-dimitar@dinux.eu> References: <20181217193052.24157-1-dimitar@dinux.eu> Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00204.txt.bz2 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. > > I ran "make check-gdb" on x86_64 to ensure there are no regressions. > > gdb/ChangeLog: > > 2018-12-17 Dimitar Dimitrov > > * nat/linux-ptrace.c (linux_ptrace_test_ret_to_nx): Remove sp > clobbers. > > [1] https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00532.html > [2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52813 > > Signed-off-by: Dimitar Dimitrov > --- > gdb/nat/linux-ptrace.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > 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) > ".globl linux_ptrace_test_ret_to_nx_instr;" > "linux_ptrace_test_ret_to_nx_instr:" > "ret" > - : : "r" (return_address) : "%esp", "memory"); > + : : "r" (return_address) : "memory"); > #elif defined __x86_64__ > asm volatile ("pushq %0;" > ".globl linux_ptrace_test_ret_to_nx_instr;" > "linux_ptrace_test_ret_to_nx_instr:" > "ret" > : : "r" ((uint64_t) (uintptr_t) return_address) > - : "%rsp", "memory"); > + : "memory"); > #else > # error "!__i386__ && !__x86_64__" > #endif LGTM: 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. Do you have push access, or would you like me to push the patch for you? Simon