From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8OEkBOyH/F+HHwAAWB0awg (envelope-from ) for ; Mon, 11 Jan 2021 12:16:28 -0500 Received: by simark.ca (Postfix, from userid 112) id 0E75C1EEEF; Mon, 11 Jan 2021 12:16:28 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 85AA81E4F4 for ; Mon, 11 Jan 2021 12:16:27 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 390CE3887030; Mon, 11 Jan 2021 17:16:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 390CE3887030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610385387; bh=p5AHJwuE7TT+s+ISG2je3pCg0NUlDoAHymXWKmfTspA=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Dv6HCkXcRZgu0T1BjuPnIIMl4s/pauxJgJqma3Bmcy1mQUdf+A+f8RphaOrWXM3jx MKq61xO9iVE+fQ2sOXJzLizTp8A0oMfkLqBl04hClaDvtzatChAjpK4W40xJovVYVF +HtlhGZCio185ozAkS1evGihWEKO4lIk7aqambrs= Received: from mail.sergiodj.net (mail.sergiodj.net [167.114.15.217]) by sourceware.org (Postfix) with ESMTPS id AB2083887025 for ; Mon, 11 Jan 2021 17:16:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AB2083887025 Received: from localhost (bras-base-toroon1016w-grc-31-76-64-52-221.dsl.bell.ca [76.64.52.221]) by mail.sergiodj.net (Postfix) with ESMTPSA id DFA8AA00BB; Mon, 11 Jan 2021 12:16:21 -0500 (EST) To: Tom de Vries Subject: Re: [PATCH][gdb/testsuite] Fix gdb.arch/amd64-stap-three-arg-disp.S References: <20210111070618.GA2149@delia> X-URL: http://blog.sergiodj.net Date: Mon, 11 Jan 2021 12:16:21 -0500 In-Reply-To: <20210111070618.GA2149@delia> (Tom de Vries's message of "Mon, 11 Jan 2021 08:06:19 +0100") Message-ID: <87bldvpf6i.fsf@paluero> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergio Durigan Junior via Gdb-patches Reply-To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On Monday, January 11 2021, Tom de Vries wrote: > Hi, > > On SLE-11 I ran into: > ... > (gdb) print $_probe_arg0^M > Cannot access memory at address 0x8000003fe05c^M > (gdb) FAIL: gdb.arch/amd64-stap-special-operands.exp: probe: three_arg: \ > print $_probe_arg0 > ... > > The memory cannot be accessed because the address used to evaluate > $_probe_arg0 at the probe point is incorrect. > > The address is calculated using this expression: > ... > .asciz "-4@-4(%rbp,%ebx,0)" > ... > which uses $ebx, but $ebx is uninitialized at the probe point. > > The test-case does contain a "movl $0, %ebx" insn to set $ebx to 0, but that > insn is placed after the probe point. We could fix this by moving the insn > to before the probe point. But, $ebx is also a callee-save register, so > normally, if we modify it, we also need to save and restore it, which is > currently not done. This is currently not harmful, because we don't run the > test-case further than the probe point, but it's bound to cause confusion. > > So, fix this instead by using $eax instead in the expression, and moving the > insn setting $eax to 0 to before the probe point. Thanks for the patch. > Any comments? The fix makes sense to me as-is. Eventually, I'd like to convert this testcase to use the same format as gdb.arch/amd64-stap-optional-prefix.S, which is much simpler to read/hack. It shouldn't be a hard thing to do, but I don't want to impose on you and ask you to do that, so if you want to go ahead and push this patch, feel free to do so. Thanks, > Thanks, > - Tom > > [gdb/testsuite] Fix gdb.arch/amd64-stap-three-arg-disp.S > > gdb/testsuite/ChangeLog: > > 2021-01-10 Tom de Vries > > PR testsuite/26968 > * gdb.arch/amd64-stap-three-arg-disp.S: Remove insn modifying $ebx. > Move insn setting $eax to before probe point. > > --- > gdb/testsuite/gdb.arch/amd64-stap-three-arg-disp.S | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/gdb/testsuite/gdb.arch/amd64-stap-three-arg-disp.S b/gdb/testsuite/gdb.arch/amd64-stap-three-arg-disp.S > index cf3856f41e9..17b64048082 100644 > --- a/gdb/testsuite/gdb.arch/amd64-stap-three-arg-disp.S > +++ b/gdb/testsuite/gdb.arch/amd64-stap-three-arg-disp.S > @@ -15,6 +15,7 @@ main: > movl %edi, -20(%rbp) > movq %rsi, -32(%rbp) > movl $10, -4(%rbp) > + movl $0, %eax > #APP > # 8 "amd64-stap-three-arg-disp.c" 1 > 990: nop > @@ -28,7 +29,7 @@ main: > .8byte 0 > .asciz "test" > .asciz "three_arg" > -.asciz "-4@-4(%rbp,%ebx,0)" > +.asciz "-4@-4(%rbp,%eax,0)" > 994: .balign 4 > .popsection > > @@ -45,8 +46,6 @@ _.stapsdt.base: .space 1 > > # 0 "" 2 > #NO_APP > - movl $0, %eax > - movl $0, %ebx > popq %rbp > .cfi_def_cfa 7, 8 > # SUCC: EXIT [100.0%] -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible https://sergiodj.net/