]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: Fix printing frame when reversing out of a recursive call with clang
authorGuinevere Larsen <blarsen@redhat.com>
Wed, 14 Aug 2024 15:03:57 +0000 (12:03 -0300)
committerGuinevere Larsen <blarsen@redhat.com>
Mon, 19 Aug 2024 12:12:05 +0000 (09:12 -0300)
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.

Approved-by: Kevin Buettner <kevinb@redhat.com>
gdb/infrun.c

index 05e81a08e03df55f5c3150b30e7c70c361035de4..f2d28cacd1ac8e0dfd1627193f672c881b5488ef 100644 (file)
@@ -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)