Shuffle user_visible_resume_ptid
authorPedro Alves <palves@redhat.com>
Tue, 24 Mar 2015 14:24:53 +0000 (14:24 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 24 Mar 2015 18:35:40 +0000 (18:35 +0000)
... 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.

gdb/ChangeLog
gdb/infrun.c
gdb/infrun.h

index fc65c603c62e019d40f60a0798f3ae76819e3506..a7d95f6ff88861d09d4729ffd3208f6ca28dcda6 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2015-03-24  Pedro Alves  <palves@redhat.com>
 
        * linux-nat.c (linux_nat_resume): Output debug logs before trying
index 3c2d2fb236ee8cf872133867c8fe32a46d954d34..ce6fb1adaca0490c78271961d9016e3f1d0b096f 100644 (file)
@@ -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;
 }
 
index ab97eea4be4d45dc4053e780559140fedd25bb53..1f09e41ca60c32c86dd2906556366073d86ed31a 100644 (file)
@@ -95,7 +95,13 @@ extern void proceed (CORE_ADDR, enum gdb_signal);
 extern void resume (enum gdb_signal);
 
 /* Return a ptid representing the set of threads that we will proceed,
-   in the perspective of the user/frontend.  */
+   in the perspective of the user/frontend.  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.  */
 extern ptid_t user_visible_resume_ptid (int step);
 
 extern void wait_for_inferior (void);
This page took 0.0334 seconds and 4 git commands to generate.