* [PATCH] gdb: Fix printing frame when reversing out of a recursive call with clang
@ 2024-08-14 16:50 Guinevere Larsen
2024-08-18 18:38 ` Kevin Buettner
0 siblings, 1 reply; 3+ messages in thread
From: Guinevere Larsen @ 2024-08-14 16:50 UTC (permalink / raw)
To: gdb-patches; +Cc: Guinevere Larsen
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] gdb: Fix printing frame when reversing out of a recursive call with clang
2024-08-14 16:50 [PATCH] gdb: Fix printing frame when reversing out of a recursive call with clang Guinevere Larsen
@ 2024-08-18 18:38 ` Kevin Buettner
2024-08-19 12:12 ` Guinevere Larsen
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2024-08-18 18:38 UTC (permalink / raw)
To: Guinevere Larsen; +Cc: gdb-patches
On Wed, 14 Aug 2024 13:50:36 -0300
Guinevere Larsen <blarsen@redhat.com> wrote:
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gdb: Fix printing frame when reversing out of a recursive call with clang
2024-08-18 18:38 ` Kevin Buettner
@ 2024-08-19 12:12 ` Guinevere Larsen
0 siblings, 0 replies; 3+ messages in thread
From: Guinevere Larsen @ 2024-08-19 12:12 UTC (permalink / raw)
To: Kevin Buettner; +Cc: gdb-patches
On 8/18/24 3:38 PM, Kevin Buettner wrote:
> On Wed, 14 Aug 2024 13:50:36 -0300
> Guinevere Larsen <blarsen@redhat.com> wrote:
>
>> 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>
>
Thanks! pushed :)
--
Cheers,
Guinevere Larsen
She/Her/Hers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-08-19 12:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-14 16:50 [PATCH] gdb: Fix printing frame when reversing out of a recursive call with clang Guinevere Larsen
2024-08-18 18:38 ` Kevin Buettner
2024-08-19 12:12 ` Guinevere Larsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox