aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-03-24 14:24:53 +0000
committerPedro Alves <palves@redhat.com>2015-03-24 18:35:40 +0000
commitf3263aa47ec109871a124a1a2d5370e42a907690 (patch)
tree9e8ae761640a3660cb4b5169f65a9e876bf39765 /gdb/infrun.c
parent2bf6fb9d85394f90abb3e21ee037a732b6e4c983 (diff)
downloadgdb-f3263aa47ec109871a124a1a2d5370e42a907690.zip
gdb-f3263aa47ec109871a124a1a2d5370e42a907690.tar.gz
gdb-f3263aa47ec109871a124a1a2d5370e42a907690.tar.bz2
Shuffle user_visible_resume_ptid
... and move comment to declaration. gdb/ChangeLog: 2015-03-24 Pedro Alves <palves@redhat.com> * infrun.c (user_visible_resume_ptid): Rewrite going from most-locked to unlocked instead of the opposite. Move comment ... * infrun.h (user_visible_resume_ptid): ... here.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 3c2d2fb..ce6fb1a 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1997,19 +1997,13 @@ maybe_software_singlestep (struct gdbarch *gdbarch, CORE_ADDR pc)
return hw_step;
}
+/* See infrun.h. */
+
ptid_t
user_visible_resume_ptid (int step)
{
- /* By default, resume all threads of all processes. */
- ptid_t resume_ptid = RESUME_ALL;
-
- /* Maybe resume only all threads of the current process. */
- if (!sched_multi && target_supports_multi_process ())
- {
- resume_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
- }
+ ptid_t resume_ptid;
- /* Maybe resume a single thread after all. */
if (non_stop)
{
/* With non-stop mode on, threads are always handled
@@ -2019,16 +2013,22 @@ user_visible_resume_ptid (int step)
else if ((scheduler_mode == schedlock_on)
|| (scheduler_mode == schedlock_step && step))
{
- /* User-settable 'scheduler' mode requires solo thread resume. */
+ /* User-settable 'scheduler' mode requires solo thread
+ resume. */
resume_ptid = inferior_ptid;
}
+ else if (!sched_multi && target_supports_multi_process ())
+ {
+ /* Resume all threads of the current process (and none of other
+ processes). */
+ resume_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
+ }
+ else
+ {
+ /* Resume all threads of all processes. */
+ resume_ptid = RESUME_ALL;
+ }
- /* We may actually resume fewer threads at first, e.g., if a thread
- is stopped at a breakpoint that needs stepping-off, but that
- should not be visible to the user/frontend, and neither should
- the frontend/user be allowed to proceed any of the threads that
- happen to be stopped for internal run control handling, if a
- previous command wanted them resumed. */
return resume_ptid;
}