forked from Imagelibrary/binutils-gdb
Factor out in-stepping-range checks.
This adds a function for doing within-thread's-stepping-range checks, and converts a couple spots to use it. Following patches will add more uses. gdb/ 2013-05-23 Yao Qi <yao@codesourcery.com> Pedro Alves <palves@redhat.com> * gdbthread.h (pc_in_thread_step_range): New declaration. * thread.c (pc_in_thread_step_range): New function. * infrun.c (handle_inferior_event): Use it.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2013-05-23 Yao Qi <yao@codesourcery.com>
|
||||||
|
Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
* gdbthread.h (pc_in_thread_step_range): New declaration.
|
||||||
|
* thread.c (pc_in_thread_step_range): New function.
|
||||||
|
* infrun.c (handle_inferior_event): Use it.
|
||||||
|
|
||||||
2013-05-23 Joel Brobecker <brobecker@adacore.com>
|
2013-05-23 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* mi/mi-cmd-break.c (mi_argv_to_format): Use xsnprintf instead
|
* mi/mi-cmd-break.c (mi_argv_to_format): Use xsnprintf instead
|
||||||
|
|||||||
@@ -399,6 +399,10 @@ extern struct thread_info* inferior_thread (void);
|
|||||||
|
|
||||||
extern void update_thread_list (void);
|
extern void update_thread_list (void);
|
||||||
|
|
||||||
|
/* Return true if PC is in the stepping range of THREAD. */
|
||||||
|
|
||||||
|
int pc_in_thread_step_range (CORE_ADDR pc, struct thread_info *thread);
|
||||||
|
|
||||||
extern struct thread_info *thread_list;
|
extern struct thread_info *thread_list;
|
||||||
|
|
||||||
#endif /* GDBTHREAD_H */
|
#endif /* GDBTHREAD_H */
|
||||||
|
|||||||
@@ -4337,8 +4337,7 @@ process_event_stop_test:
|
|||||||
|
|
||||||
if (ecs->event_thread->control.step_range_end != 0
|
if (ecs->event_thread->control.step_range_end != 0
|
||||||
&& ecs->event_thread->suspend.stop_signal != GDB_SIGNAL_0
|
&& ecs->event_thread->suspend.stop_signal != GDB_SIGNAL_0
|
||||||
&& (ecs->event_thread->control.step_range_start <= stop_pc
|
&& pc_in_thread_step_range (stop_pc, ecs->event_thread)
|
||||||
&& stop_pc < ecs->event_thread->control.step_range_end)
|
|
||||||
&& frame_id_eq (get_stack_frame_id (frame),
|
&& frame_id_eq (get_stack_frame_id (frame),
|
||||||
ecs->event_thread->control.step_stack_frame_id)
|
ecs->event_thread->control.step_stack_frame_id)
|
||||||
&& ecs->event_thread->control.step_resume_breakpoint == NULL)
|
&& ecs->event_thread->control.step_resume_breakpoint == NULL)
|
||||||
@@ -4707,8 +4706,7 @@ process_event_stop_test:
|
|||||||
through a function epilogue and therefore must detect when
|
through a function epilogue and therefore must detect when
|
||||||
the current-frame changes in the middle of a line. */
|
the current-frame changes in the middle of a line. */
|
||||||
|
|
||||||
if (stop_pc >= ecs->event_thread->control.step_range_start
|
if (pc_in_thread_step_range (stop_pc, ecs->event_thread)
|
||||||
&& stop_pc < ecs->event_thread->control.step_range_end
|
|
||||||
&& (execution_direction != EXEC_REVERSE
|
&& (execution_direction != EXEC_REVERSE
|
||||||
|| frame_id_eq (get_frame_id (frame),
|
|| frame_id_eq (get_frame_id (frame),
|
||||||
ecs->event_thread->control.step_frame_id)))
|
ecs->event_thread->control.step_frame_id)))
|
||||||
|
|||||||
@@ -750,6 +750,13 @@ finish_thread_state_cleanup (void *arg)
|
|||||||
finish_thread_state (*ptid_p);
|
finish_thread_state (*ptid_p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
pc_in_thread_step_range (CORE_ADDR pc, struct thread_info *thread)
|
||||||
|
{
|
||||||
|
return (pc >= thread->control.step_range_start
|
||||||
|
&& pc < thread->control.step_range_end);
|
||||||
|
}
|
||||||
|
|
||||||
/* Prints the list of threads and their details on UIOUT.
|
/* Prints the list of threads and their details on UIOUT.
|
||||||
This is a version of 'info_threads_command' suitable for
|
This is a version of 'info_threads_command' suitable for
|
||||||
use from MI.
|
use from MI.
|
||||||
|
|||||||
Reference in New Issue
Block a user