From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id DGC/JYbgvGZhGQcAWB0awg (envelope-from ) for ; Wed, 14 Aug 2024 12:51:18 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=FT7txPtY; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8897A1E0D0; Wed, 14 Aug 2024 12:51:18 -0400 (EDT) Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5ACA01E08C for ; Wed, 14 Aug 2024 12:51:16 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D536A3858424 for ; Wed, 14 Aug 2024 16:51:15 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id C2F413858D20 for ; Wed, 14 Aug 2024 16:50:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C2F413858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C2F413858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723654252; cv=none; b=g7Ro4bCuaED2J5IkxXhVAiQLY0t8MKFTikRaK8c39H76Q6v8a8y82IDQ91+dUg5tpcbjDWOvwSpOTrkRtH7ta0hy0PMKS0Y+E598NQ9Y8lZxFWb6VbStlsCB/GLbE2WPtL1XY5aW8fQ3QyhLaU7NlYlUsO6S4AUz5DiD9rfm+D8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723654252; c=relaxed/simple; bh=KnsYxGnKbMC/ivfv3L6//A51UhBMPxf8ZsK/e1oOSVw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hfuO/y+zWbOeGzSqi+MooGrf90cO8zXzoyPogg8XBqkoEWdYUXSf99SShqZyMNHQWUZrhKqZpV+aOu41NkjtO0RlRkCtdwav639TkvGJ5KSYqPorW+k9eMdT83DKrrD4v0R5Bh8nF2IznDoE2woanNjGo1hyNGVLGhIJ1Eji6dg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1723654251; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=dRuUoaRMn6PqSnimOnRr6r5xflsUlHrEG+6k5N+js5Q=; b=FT7txPtYqf6ZMM3J3EDGbPBT85ceIRUo+uH/YAOdTt0LL0PgGKw1UIZ+YDx/uV2M9Ht/GH OPXr9pFpDCDzxDbqlpYmrgEdIsw6PD+5P8nLrcmJ2Ojqrlx+tV3Wd8PH08gY8b+rgP8x7/ rJhiuztCWKbWGFHBPysyTrvRZQvW9fc= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-471-gL6uQ1aAM56TxIp-9Nxz6g-1; Wed, 14 Aug 2024 12:50:44 -0400 X-MC-Unique: gL6uQ1aAM56TxIp-9Nxz6g-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8D6DE19776C9 for ; Wed, 14 Aug 2024 16:50:43 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.96.134.39]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7A7A619560AA; Wed, 14 Aug 2024 16:50:42 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH] gdb: Fix printing frame when reversing out of a recursive call with clang Date: Wed, 14 Aug 2024 13:50:36 -0300 Message-ID: <20240814165036.2951260-1-blarsen@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 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=-11.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Commit bf2813aff8f2988ad3d53e819a0415abf295c91f introduced some logic to not refresh the step frame id if it detects that the inferior is reverse stepping out of a recursive call, so that we would still print frame information once the inferior stops. However, that logic was overly specific, and wouldn't be hit for inferiors compiled with clang because clang adds line table entries that aren't statements, making process_event_stop_test go through a different branch on the relevant if statement. Fix this by not making the code that detects "reversing out of a recursion" an else clause to the previous if, but a standalone if block. --- gdb/infrun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/infrun.c b/gdb/infrun.c index 05e81a08e03..f2d28cacd1a 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -8245,7 +8245,8 @@ process_event_stop_test (struct execution_control_state *ecs) "it's not the start of a statement"); } } - else if (execution_direction == EXEC_REVERSE + + if (execution_direction == EXEC_REVERSE && *curr_frame_id != original_frame_id && original_frame_id.code_addr_p && curr_frame_id->code_addr_p && original_frame_id.code_addr == curr_frame_id->code_addr) -- 2.46.0