aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2008-09-08 21:52:25 +0000
committerPedro Alves <palves@redhat.com>2008-09-08 21:52:25 +0000
commitaf679fd00340269efb8474ee49a343dccaea9700 (patch)
treeb79c4d378442486a84c56a6fee06f4a7c44c4705 /gdb/infcmd.c
parent2020b7abd8daa9b0204aa39bfcda2d6f9f45a1f1 (diff)
downloadgdb-af679fd00340269efb8474ee49a343dccaea9700.zip
gdb-af679fd00340269efb8474ee49a343dccaea9700.tar.gz
gdb-af679fd00340269efb8474ee49a343dccaea9700.tar.bz2
Remove the global step_multi in favour of a per-thread
step_multi. * inferior.h (step_multi): Delete. * gdbthread.h (struct thread_info): Add comments around step_multi. (save_infrun_state, load_infrun_state): Remove step_multi parameter. * thread.c (load_infrun_state, save_infrun_state): Remove step_multi argument, and references to it. * infcmd.c (step_multi): Delete. (step_1): Adjust. (step_1_continuation, until_next_command): Adjust. * infrun.c (fetch_inferior_event): Adjust. (context_switch): Don't context-switch step_multi. (print_stop_reason, normal_stop): Adjust.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 055b228..afe6d55 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -169,12 +169,6 @@ int stop_stack_dummy;
int stopped_by_random_signal;
-/* If stepping, nonzero means step count is > 1
- so don't print frame next time inferior stops
- if it stops due to stepping. */
-
-int step_multi;
-
/* Environment to use for running inferior,
in format described in environ.h. */
@@ -829,7 +823,7 @@ which has no line number information.\n"), name);
if (skip_subroutines)
tp->step_over_calls = STEP_OVER_ALL;
- step_multi = (count > 1);
+ tp->step_multi = (count > 1);
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
if (!stop_step)
@@ -870,16 +864,25 @@ step_1_continuation (void *args)
{
struct step_1_continuation_args *a = args;
- if (!step_multi || !stop_step)
+ if (target_has_execution)
{
- /* If we stopped for some reason that is not stepping there are
- no further steps to make. Cleanup. */
- if (!a->single_inst || a->skip_subroutines)
- delete_longjmp_breakpoint (a->thread);
- step_multi = 0;
+ struct thread_info *tp;
+
+ tp = inferior_thread ();
+ if (tp->step_multi && stop_step)
+ {
+ /* There are more steps to make, and we did stop due to
+ ending a stepping range. Do another step. */
+ step_once (a->skip_subroutines, a->single_inst, a->count - 1, a->thread);
+ return;
+ }
+ tp->step_multi = 0;
}
- else
- step_once (a->skip_subroutines, a->single_inst, a->count - 1, a->thread);
+
+ /* We either stopped for some reason that is not stepping, or there
+ are no further steps to make. Cleanup. */
+ if (!a->single_inst || a->skip_subroutines)
+ delete_longjmp_breakpoint (a->thread);
}
/* Do just one step operation. If count >1 we will have to set up a
@@ -947,7 +950,7 @@ which has no line number information.\n"), name);
if (skip_subroutines)
tp->step_over_calls = STEP_OVER_ALL;
- step_multi = (count > 1);
+ inferior_thread ()->step_multi = (count > 1);
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
args = xmalloc (sizeof (*args));
@@ -1178,7 +1181,7 @@ until_next_command (int from_tty)
tp->step_over_calls = STEP_OVER_ALL;
tp->step_frame_id = get_frame_id (frame);
- step_multi = 0; /* Only one call to proceed */
+ tp->step_multi = 0; /* Only one call to proceed */
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
}