From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4EVrBDvoV2PLfxAAWB0awg (envelope-from ) for ; Tue, 25 Oct 2022 09:44:27 -0400 Received: by simark.ca (Postfix, from userid 112) id 0692B1E112; Tue, 25 Oct 2022 09:44:27 -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=C988gU/B; 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=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.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 792F21E0D5 for ; Tue, 25 Oct 2022 09:44:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 23C54385AC0A for ; Tue, 25 Oct 2022 13:44:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23C54385AC0A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666705466; bh=xmDoElQc8QUlRJq7UXalxpDDF3qnO4XKn/IiXznBGos=; 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=C988gU/Bf8MVpOiU8Wg54Bla6vptZguo+dcreVentJnNJF98ETj99KP2v3FY7QT8M mhwfEFizTZE/yqxtVDorM1nv15o8nSb+Dce3/xNJenn10vkkmXdSiezZ7OS8L+6hEt EKHnEx+DYPcmcmMhLqx/E1cFO2TkfHohFBVSsdMo= Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D0131385737C for ; Tue, 25 Oct 2022 13:44:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D0131385737C 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 526741E0D5; Tue, 25 Oct 2022 09:44:04 -0400 (EDT) Message-ID: Date: Tue, 25 Oct 2022 09:44:03 -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 1/2] Change calculation of frame_id by amd64 epilogue unwinder Content-Language: fr To: Bruno Larsen , gdb-patches@sourceware.org References: <20221005103832.3163424-1-blarsen@redhat.com> <20221005103832.3163424-2-blarsen@redhat.com> In-Reply-To: <20221005103832.3163424-2-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: > When GDB is stopped at a ret instruction and no debug information is > available for unwinding, GDB defaults to the amd64 epilogue unwinder, to > be able to generate a decent backtrace. However, when calculating the > frame id, the epilogue unwinder generates information as if the return > instruction was the whole frame. > > This was an issue especially when attempting to reverse debug, as GDB > would place a step_resume_breakpoint from the epilogue of a function if > we were to attempt to skip that function, and this breakpoint should > ideally have the current function's frame_id to avoid other problems > such as PR record/16678. > > This commit changes the frame_id calculation for the amd64 epilogue, > so that it is always the same as the dwarf2 unwinder's frame_id. > > It also adds a test to confirm that the frame_id will be the same, > regardless of using the epilogue unwinder or not, thanks to Andrew > Burgess. > > Co-Authored-By: Andrew Burgess > --- > gdb/amd64-tdep.c | 10 +- > .../gdb.base/unwind-on-each-insn-foo.c | 22 +++ > gdb/testsuite/gdb.base/unwind-on-each-insn.c | 25 +++ > .../gdb.base/unwind-on-each-insn.exp | 154 ++++++++++++++++++ > 4 files changed, 206 insertions(+), 5 deletions(-) > create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn-foo.c > create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn.c > create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn.exp Hi Bruno, On Ubuntu 22.04, I can get this new test to fail quite reliably with: $ taskset -c 1 make check TESTS="gdb.base/unwind-on-each-insn.exp" RUNTESTFLAGS="--target_board=native-gdbserver" Can you give it a try? Simon