From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ju8ZGg35V2NIhBAAWB0awg (envelope-from ) for ; Tue, 25 Oct 2022 10:56:13 -0400 Received: by simark.ca (Postfix, from userid 112) id 5A53E1E11A; Tue, 25 Oct 2022 10:56:13 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ZwwOSb2t; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [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 D7D491E0D3 for ; Tue, 25 Oct 2022 10:56:12 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 518403856DC5 for ; Tue, 25 Oct 2022 14:56:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 518403856DC5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666709771; bh=HxAp8qrgegvOiqzQgA1CnbKGcaW7NYztJQtymuNk+H0=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ZwwOSb2toetbyPnMcA6eYDqbE5dp9F6C77lMI4uBRnARJ21Of91oTVEf0D1y2Rnq1 2qOd0RkBXhAaL5gNUr1TTHy/+6NwbtL95Yvxtk9SyuLiOe7Z5LeWNQ8b9WoThKY5cZ Ii7acbfC0gBPmLVv+Wrzcdcb8Nf1npmvVX7RnEDs= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id CCACF3857023 for ; Tue, 25 Oct 2022 14:55:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CCACF3857023 Received: from [10.0.0.85] (modemcable162.249-56-74.mc.videotron.ca [74.56.249.162]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 8998A1E0D3; Tue, 25 Oct 2022 10:55:50 -0400 (EDT) Message-ID: <95cc9197-e54a-f6ea-8092-d6d0063c58a3@simark.ca> Date: Tue, 25 Oct 2022 10:55:50 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH v4 2/2] gdb/reverse: Fix stepping over recursive functions Content-Language: fr To: Bruno Larsen , gdb-patches@sourceware.org References: <20221005103832.3163424-1-blarsen@redhat.com> <20221005103832.3163424-3-blarsen@redhat.com> In-Reply-To: <20221005103832.3163424-3-blarsen@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 10/5/22 06:38, Bruno Larsen via Gdb-patches wrote: > Currently, when using GDB to do reverse debugging, if we try to use the > command "reverse next" to skip a recursive function, instead of skipping > all of the recursive calls and stopping in the previous line, we stop at > the second to last recursive call, and need to manually step backwards > until we leave the first call. This is well documented in PR gdb/16678. > > This bug happens because when GDB notices that a reverse step has > entered into a function, GDB will add a step_resume_breakpoint at the > start of the function, then single step out of the prologue once that > breakpoint is hit. The problem was happening because GDB wouldn't give > that step_resume_breakpoint a frame-id, so the first time the breakpoint > was hit, the inferior would be stopped. This is fixed by giving the > current frame-id to the breakpoint. > > This commit also changes gdb.reverse/step-reverse.c to contain a > recursive function and attempt to both, skip it altogether, and to skip > the second call from inside the first call, as this setup broke a > previous version of the patch. > --- > gdb/infrun.c | 2 +- > gdb/testsuite/gdb.reverse/step-precsave.exp | 6 ++- > gdb/testsuite/gdb.reverse/step-reverse.c | 19 ++++++- > gdb/testsuite/gdb.reverse/step-reverse.exp | 55 +++++++++++++++++++-- > 4 files changed, 74 insertions(+), 8 deletions(-) Hi Bruno, I see these failures since this commit: $ make check TESTS="gdb.reverse/step-reverse.exp" RUNTESTFLAGS="--target_board=native-gdbserver" FAIL: gdb.reverse/step-reverse.exp: reverse next over recursion again FAIL: gdb.reverse/step-reverse.exp: enter recursive function FAIL: gdb.reverse/step-reverse.exp: step over recursion inside the recursion Simon