From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 6F3CF3858C54 for ; Wed, 5 Oct 2022 10:43:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6F3CF3858C54 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-607-af0D-6R_PyOgX_8NQU0n5A-1; Wed, 05 Oct 2022 06:43:11 -0400 X-MC-Unique: af0D-6R_PyOgX_8NQU0n5A-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 870B61C05153 for ; Wed, 5 Oct 2022 10:43:11 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.43.2.105]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C2792166B26; Wed, 5 Oct 2022 10:43:10 +0000 (UTC) From: Bruno Larsen To: gdb-patches@sourceware.org Subject: [PATCH v4 0/2] Fix reverse nexting over recursions Date: Wed, 5 Oct 2022 12:38:31 +0200 Message-Id: <20221005103832.3163424-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, 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 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: , X-List-Received-Date: Wed, 05 Oct 2022 10:43:14 -0000 This patch series fixes gdb record/16678, GDB being unable to reverse-next over a recursive function. However, the simple way to fix it hit a snag when I discovered that the amd64 epilogue unwinder would give a different frame id than the dwarf2 unwinder would in the rest of the function. This patch series first change this discrepancy, then fixes the bug. Changelog for v4: * more style fixes, thanks Pedro. * Reworked part of the test, as it was not detecting failures correctly. Changelog for v3: * fix some comments on the amd64_epilogue_unwinder * fix style for the step-reverse test Changelog for v2: * Implemented Pedro Alves's suggestion to simplify the fix * Added the first patch to fix a regression that the simple fix would introduce. Bruno Larsen (2): Change calculation of frame_id by amd64 epilogue unwinder gdb/reverse: Fix stepping over recursive functions gdb/amd64-tdep.c | 10 +- gdb/infrun.c | 2 +- .../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 ++++++++++++++++++ gdb/testsuite/gdb.reverse/step-precsave.exp | 6 +- gdb/testsuite/gdb.reverse/step-reverse.c | 19 ++- gdb/testsuite/gdb.reverse/step-reverse.exp | 55 ++++++- 8 files changed, 280 insertions(+), 13 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 -- 2.37.3