summaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorCarl Love <cel@us.ibm.com>2023-01-18 11:13:17 -0500
committerCarl Love <cel@us.ibm.com>2023-01-18 11:13:17 -0500
commitb986eec55f460a9c77a0c06ec30d7280293f7a8c (patch)
tree0d78a889928fc6a76904b3689d36f134fe4d17b7 /gdb/infrun.c
parent15d2b36c5b60795067cec773a66d2627d2bf9266 (diff)
downloadbinutils-gdb-b986eec55f460a9c77a0c06ec30d7280293f7a8c.tar.gz
Revert "X86: reverse-finish fix"
This reverts commit b22548ddb30bfb167708e82d3bb932461c1b703a. This patch is being reverted since the patch series is causing regressions.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 05b150b1b63..edfb5ab0a91 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2748,6 +2748,8 @@ clear_proceed_status_thread (struct thread_info *tp)
tp->control.stop_step = 0;
+ tp->control.proceed_to_finish = 0;
+
tp->control.stepping_command = 0;
/* Discard any remaining commands or status from previous stop. */
@@ -6735,27 +6737,31 @@ process_event_stop_test (struct execution_control_state *ecs)
case BPSTAT_WHAT_STEP_RESUME:
infrun_debug_printf ("BPSTAT_WHAT_STEP_RESUME");
- delete_step_resume_breakpoint (ecs->event_thread);
- fill_in_stop_func (gdbarch, ecs);
- if (execution_direction == EXEC_REVERSE)
+ delete_step_resume_breakpoint (ecs->event_thread);
+ if (ecs->event_thread->control.proceed_to_finish
+ && execution_direction == EXEC_REVERSE)
{
struct thread_info *tp = ecs->event_thread;
- /* We are finishing a function in reverse or stepping over a function
- call in reverse, and just hit the step-resume breakpoint at the
- start address of the function, and we're almost there -- just need
- to back up to the function call. */
-
- stop_pc_sal = find_pc_line (ecs->event_thread->stop_pc (), 0);
-
- /* When setting a step range, need to call set_step_info
- to setup the current_line/symtab fields as well. */
- set_step_info (tp, frame, stop_pc_sal);
- /* Return using a step range so we will keep stepping back to the
- first instruction in the source code line. */
- tp->control.step_range_start = ecs->stop_func_start;
- tp->control.step_range_end = ecs->stop_func_start;
+ /* We are finishing a function in reverse, and just hit the
+ step-resume breakpoint at the start address of the
+ function, and we're almost there -- just need to back up
+ by one more single-step, which should take us back to the
+ function call. */
+ tp->control.step_range_start = tp->control.step_range_end = 1;
+ keep_going (ecs);
+ return;
+ }
+ fill_in_stop_func (gdbarch, ecs);
+ if (ecs->event_thread->stop_pc () == ecs->stop_func_start
+ && execution_direction == EXEC_REVERSE)
+ {
+ /* We are stepping over a function call in reverse, and just
+ hit the step-resume breakpoint at the start address of
+ the function. Go back to single-stepping, which should
+ take us back to the function call. */
+ ecs->event_thread->stepping_over_breakpoint = 1;
keep_going (ecs);
return;
}