aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-03-24 17:50:30 +0000
committerPedro Alves <palves@redhat.com>2015-03-24 17:50:30 +0000
commit885eeb5b8ea021cc79ffebe8ec40122229c572f0 (patch)
tree4c383d452a8828bda3a39c5d5e7f2ae7bf08790a /gdb
parent3333f03ae1b02b321717b4bc4887201ed4fc6a26 (diff)
downloadgdb-885eeb5b8ea021cc79ffebe8ec40122229c572f0.zip
gdb-885eeb5b8ea021cc79ffebe8ec40122229c572f0.tar.gz
gdb-885eeb5b8ea021cc79ffebe8ec40122229c572f0.tar.bz2
Make step_start_function be per thread
I noticed that step_start_function is still a global, while it obviously should be a per-thread field. gdb/ChangeLog: 2015-03-24 Pedro Alves <palves@redhat.com> * infrun.c (step_start_function): Delete and ... * gdbthread.h (struct thread_control_state) <step_start_function>: ... now a field here. * infrun.c (clear_proceed_status_thread): Clear the thread's step_start_function. (proceed, process_event_stop_test, print_stop_event): Adjust.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/gdbthread.h3
-rw-r--r--gdb/infrun.c12
3 files changed, 17 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0bb5aeb..d131d9a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,14 @@
2015-03-24 Pedro Alves <palves@redhat.com>
+ * infrun.c (step_start_function): Delete and ...
+ * gdbthread.h (struct thread_control_state) <step_start_function>:
+ ... now a field here.
+ * infrun.c (clear_proceed_status_thread): Clear the thread's
+ step_start_function.
+ (proceed, process_event_stop_test, print_stop_event): Adjust.
+
+2015-03-24 Pedro Alves <palves@redhat.com>
+
* infrun.c (proceed): No longer handle negative step.
2015-03-24 Gary Benson <gbenson@redhat.com>
diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index e9ae47d..ce4f76f 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -73,6 +73,9 @@ struct thread_control_state
CORE_ADDR step_range_start; /* Inclusive */
CORE_ADDR step_range_end; /* Exclusive */
+ /* Function the thread was in as of last it started stepping. */
+ struct symbol *step_start_function;
+
/* If GDB issues a target step request, and this is nonzero, the
target should single-step this thread once, and then continue
single-stepping it without GDB core involvement as long as the
diff --git a/gdb/infrun.c b/gdb/infrun.c
index ed4ba79..be1cc74 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -326,10 +326,6 @@ update_signals_program_target (void)
static struct cmd_list_element *stop_command;
-/* Function inferior was in as of last step command. */
-
-static struct symbol *step_start_function;
-
/* Nonzero if we want to give control to the user when we're notified
of shared library events by the dynamic linker. */
int stop_on_solib_events;
@@ -2409,6 +2405,7 @@ clear_proceed_status_thread (struct thread_info *tp)
tp->control.step_frame_id = null_frame_id;
tp->control.step_stack_frame_id = null_frame_id;
tp->control.step_over_calls = STEP_OVER_UNDEBUGGABLE;
+ tp->control.step_start_function = NULL;
tp->stop_requested = 0;
tp->control.stop_step = 0;
@@ -2589,7 +2586,7 @@ proceed (CORE_ADDR addr, enum gdb_signal siggnal, int step)
tp = inferior_thread ();
if (step)
- step_start_function = find_pc_function (pc);
+ tp->control.step_start_function = find_pc_function (pc);
/* Fill in with reasonable starting values. */
init_thread_stepping_state (tp);
@@ -5171,7 +5168,8 @@ process_event_stop_test (struct execution_control_state *ecs)
ecs->event_thread->control.step_stack_frame_id)
&& (!frame_id_eq (ecs->event_thread->control.step_stack_frame_id,
outer_frame_id)
- || step_start_function != find_pc_function (stop_pc))))
+ || (ecs->event_thread->control.step_start_function
+ != find_pc_function (stop_pc)))))
{
CORE_ADDR real_stop_pc;
@@ -6444,7 +6442,7 @@ print_stop_event (struct target_waitstatus *ws)
if (tp->control.stop_step
&& frame_id_eq (tp->control.step_frame_id,
get_frame_id (get_current_frame ()))
- && step_start_function == find_pc_function (stop_pc))
+ && tp->control.step_start_function == find_pc_function (stop_pc))
{
/* Finished step, just print source line. */
source_flag = SRC_LINE;