From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id D36C7385AE75 for ; Tue, 25 Oct 2022 16:22:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D36C7385AE75 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1CAB521FEA; Tue, 25 Oct 2022 16:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1666714951; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kesZMdobDdZb7ln7NheSStsQ92IHLgynDMxAULWjpUk=; b=PTh59i7N7xdZL/9hsx7vLUi6daqu0FuEcJKyB4ulTXPpLmuxE4TK7m4pA2EoeBcfDNPka9 oe1dmKbcHr6wRUyp7Lfrg4264nTaXss/DrMfUOlcgncuqJX6Uw7jDrZkMbVqg1vlEH3Lsu USTJfZOSdqqbCAfZkplRtm/VMNwOLBg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1666714951; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kesZMdobDdZb7ln7NheSStsQ92IHLgynDMxAULWjpUk=; b=tnSiBGx4SaDT+1Fh1GiPrjA7jU9ugtZmXseNTWupsxqFQc6AFGKDaY4brox/rRb1A/X0Bl E1hIOtd41wS+KsBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0131F134CA; Tue, 25 Oct 2022 16:22:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id O6meOkYNWGMfGgAAMHmgww (envelope-from ); Tue, 25 Oct 2022 16:22:30 +0000 Message-ID: Date: Tue, 25 Oct 2022 18:22:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v4 2/2] gdb/reverse: Fix stepping over recursive functions Content-Language: en-US To: Simon Marchi , Bruno Larsen , gdb-patches@sourceware.org References: <20221005103832.3163424-1-blarsen@redhat.com> <20221005103832.3163424-3-blarsen@redhat.com> <95cc9197-e54a-f6ea-8092-d6d0063c58a3@simark.ca> From: Tom de Vries In-Reply-To: <95cc9197-e54a-f6ea-8092-d6d0063c58a3@simark.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 10/25/22 16:55, Simon Marchi via Gdb-patches wrote: > 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 > On aarch64, I ran into another regression due to this commit (test-case gdb.reverse/solib-precsave.exp), filed as https://sourceware.org/bugzilla/show_bug.cgi?id=29721 . Thanks, - Tom