#include "valprint.h"
#include "inline-frame.h"
#include "tracepoint.h"
+#include "inf-loop.h"
+#include "continuations.h"
/* Functions exported for general use, in inferior.h: */
{
for (; count > 0; count--)
{
- struct thread_info *tp;
-
step_once (skip_subroutines, single_inst, count, thread);
- if (target_has_execution
- && !ptid_equal (inferior_ptid, null_ptid))
- tp = inferior_thread ();
+ if (!target_has_execution)
+ break;
else
- tp = NULL;
-
- if (!tp || !tp->control.stop_step || !tp->step_multi)
{
- /* If we stopped for some reason that is not stepping
- there are no further steps to make. */
- if (tp)
- tp->step_multi = 0;
- break;
+ struct thread_info *tp = inferior_thread ();
+
+ if (!tp->control.stop_step || !tp->step_multi)
+ {
+ /* If we stopped for some reason that is not stepping
+ there are no further steps to make. */
+ tp->step_multi = 0;
+ break;
+ }
}
}
if (!skip_subroutines && !single_inst
&& inline_skipped_frames (inferior_ptid))
{
+ ptid_t resume_ptid;
+
+ /* Pretend that we've ran. */
+ resume_ptid = user_visible_resume_ptid (1);
+ set_running (resume_ptid, 1);
+
step_into_inline_frame (inferior_ptid);
if (count > 1)
step_once (skip_subroutines, single_inst, count - 1, thread);
else
- /* Pretend that we've stopped. */
- normal_stop ();
+ {
+ /* Pretend that we've stopped. */
+ normal_stop ();
+
+ if (target_can_async_p ())
+ inferior_event_handler (INF_EXEC_COMPLETE, NULL);
+ }
return;
}
{
struct symtab_and_line sal;
struct thread_info *tp = inferior_thread ();
- struct breakpoint *breakpoint;
- struct cleanup *old_chain;
CORE_ADDR pc;
CORE_ADDR func_addr;
- int back_up;
pc = get_frame_pc (get_current_frame ());
sal = find_pc_line (func_addr, 0);
- /* We don't need a return value. */
- tp->control.proceed_to_finish = 0;
+ tp->control.proceed_to_finish = 1;
/* Special case: if we're sitting at the function entry point,
then all we need to do is take a reverse singlestep. We
don't need to set a breakpoint, and indeed it would do us
{
struct frame_info *frame = get_selected_frame (NULL);
struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct symtab_and_line sr_sal;
+
+ /* Set a step-resume at the function's entry point. Once that's
+ hit, we'll do one more step backwards. */
+ init_sal (&sr_sal);
+ sr_sal.pc = sal.pc;
+ sr_sal.pspace = get_frame_program_space (frame);
+ insert_step_resume_breakpoint_at_sal (gdbarch,
+ sr_sal, null_frame_id);
- /* Set breakpoint and continue. */
- breakpoint =
- set_momentary_breakpoint (gdbarch, sal,
- get_stack_frame_id (frame),
- bp_breakpoint);
- /* Tell the breakpoint to keep quiet. We won't be done
- until we've done another reverse single-step. */
- breakpoint_set_silent (breakpoint, 1);
- old_chain = make_cleanup_delete_breakpoint (breakpoint);
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0);
- /* We will be stopped when proceed returns. */
- back_up = (bpstat_find_breakpoint (tp->control.stop_bpstat, breakpoint)
- != NULL);
- do_cleanups (old_chain);
}
else
- back_up = 1;
- if (back_up)
{
- /* If in fact we hit the step-resume breakpoint (and not
- some other breakpoint), then we're almost there --
- we just need to back up by one more single-step. */
+ /* We're almost there -- we just need to back up by one more
+ single-step. */
tp->control.step_range_start = tp->control.step_range_end = 1;
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
}
- return;
}
/* finish_forward -- helper function for finish_command. */
if (async_exec && !target_can_async_p ())
error (_("Asynchronous execution not supported on this target."));
- /* Don't try to async in reverse. */
- if (async_exec && execution_direction == EXEC_REVERSE)
- error (_("Asynchronous 'finish' not supported in reverse."));
-
/* If we are not asked to run in the bg, then prepare to run in the
foreground, synchronously. */
if (!async_exec && target_can_async_p ())
return;
}
- wait_for_inferior (0);
+ wait_for_inferior ();
}
attach_command_post_wait (args, from_tty, async_exec);
return;
}
else
- wait_for_inferior (0);
+ wait_for_inferior ();
}
async_exec = leave_running;