Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Make continuations per-thread.
@ 2008-04-24 23:08 Vladimir Prus
  2008-05-02  3:00 ` Daniel Jacobowitz
  0 siblings, 1 reply; 12+ messages in thread
From: Vladimir Prus @ 2008-04-24 23:08 UTC (permalink / raw)
  To: gdb-patches


Right now, continuations are global. This means that if we're doing
'finish' in one thread, then we cannot do 'finish' or anything that
also uses continuations, in any other thread. This seems unnecessary
limitation, and this patch makes continuations per-thread.

Further into non-stop series, it really allows me to do 'finish' or 'step'
in several threads independently.

OK?

- Volodya

---
 gdb/gdbthread.h |   15 +++++++++++++--
 gdb/infrun.c    |    8 ++++++--
 gdb/thread.c    |   16 ++++++++++++++--
 3 files changed, 33 insertions(+), 6 deletions(-)

diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h
index 6cfb1f9..56cbd51 100644
--- a/gdb/gdbthread.h
+++ b/gdb/gdbthread.h
@@ -64,6 +64,11 @@ struct thread_info
      when we finally do stop stepping.  */
   bpstat stepping_through_solib_catchpoints;
 
+  struct continuation *continuations;
+  struct continuation *intermediate_continations;
+
+  int proceed_to_finish;
+
   /* Private data used by the target vector implementation.  */
   struct private_thread_info *private;
 };
@@ -130,7 +135,10 @@ extern void save_infrun_state (ptid_t ptid,
 			       int       stepping_through_solib_after_catch,
 			       bpstat    stepping_through_solib_catchpoints,
 			       int       current_line,
-			       struct symtab *current_symtab);
+			       struct symtab *current_symtab,
+			       struct continuation *continuations,
+			       struct continuation *intermediate_continations,
+			       int proceed_to_finish);
 
 /* infrun context switch: load the debugger state previously saved
    for the given thread.  */
@@ -146,7 +154,10 @@ extern void load_infrun_state (ptid_t ptid,
 			       int       *stepping_through_solib_affter_catch,
 			       bpstat    *stepping_through_solib_catchpoints,
 			       int       *current_line,
-			       struct symtab **current_symtab);
+			       struct symtab **current_symtab,
+			       struct continuation **continuations,
+			       struct continuation **intermediate_continations,
+			       int *proceed_to_finish);
 
 /* Switch from one thread to another.  */
 extern void switch_to_thread (ptid_t ptid);
diff --git a/gdb/infrun.c b/gdb/infrun.c
index d68b7a5..d6e2c62 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1518,7 +1518,9 @@ context_switch (struct execution_control_state *ecs)
 			 ecs->handling_longjmp, ecs->stepping_over_breakpoint,
 			 ecs->stepping_through_solib_after_catch,
 			 ecs->stepping_through_solib_catchpoints,
-			 ecs->current_line, ecs->current_symtab);
+			 ecs->current_line, ecs->current_symtab,
+			 cmd_continuation, intermediate_continuation,
+			 proceed_to_finish);
 
       /* Load infrun state for the new thread.  */
       load_infrun_state (ecs->ptid, &prev_pc,
@@ -1528,7 +1530,9 @@ context_switch (struct execution_control_state *ecs)
 			 &ecs->handling_longjmp, &ecs->stepping_over_breakpoint,
 			 &ecs->stepping_through_solib_after_catch,
 			 &ecs->stepping_through_solib_catchpoints,
-			 &ecs->current_line, &ecs->current_symtab);
+			 &ecs->current_line, &ecs->current_symtab,
+			 &cmd_continuation, &intermediate_continuation,
+			 &proceed_to_finish);
     }
 
   switch_to_thread (ecs->ptid);
diff --git a/gdb/thread.c b/gdb/thread.c
index 431d88f..bba32e8 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -333,7 +333,10 @@ load_infrun_state (ptid_t ptid,
 		   int *stepping_through_solib_after_catch,
 		   bpstat *stepping_through_solib_catchpoints,
 		   int *current_line,
-		   struct symtab **current_symtab)
+		   struct symtab **current_symtab,
+		   struct continuation **continuations,
+		   struct continuation **intermediate_continations,
+		   int *proceed_to_finish)
 {
   struct thread_info *tp;
 
@@ -357,6 +360,9 @@ load_infrun_state (ptid_t ptid,
     tp->stepping_through_solib_catchpoints;
   *current_line = tp->current_line;
   *current_symtab = tp->current_symtab;
+  *continuations = tp->continuations;
+  *intermediate_continations = tp->intermediate_continations;
+  *proceed_to_finish = tp->proceed_to_finish;
 }
 
 /* Save infrun state for the thread PID.  */
@@ -374,7 +380,10 @@ save_infrun_state (ptid_t ptid,
 		   int stepping_through_solib_after_catch,
 		   bpstat stepping_through_solib_catchpoints,
 		   int current_line,
-		   struct symtab *current_symtab)
+		   struct symtab *current_symtab,
+		   struct continuation *continuations,
+		   struct continuation *intermediate_continations,
+		   int proceed_to_finish)
 {
   struct thread_info *tp;
 
@@ -396,6 +405,9 @@ save_infrun_state (ptid_t ptid,
   tp->stepping_through_solib_catchpoints = stepping_through_solib_catchpoints;
   tp->current_line = current_line;
   tp->current_symtab = current_symtab;
+  tp->continuations = continuations;
+  tp->intermediate_continations = intermediate_continations;
+  tp->proceed_to_finish = proceed_to_finish;
 }
 
 /* Return true if TP is an active thread. */
-- 
1.5.3.5


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2008-05-06 18:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-24 23:08 [RFA] Make continuations per-thread Vladimir Prus
2008-05-02  3:00 ` Daniel Jacobowitz
2008-05-02 11:34   ` Pedro Alves
2008-05-02 11:43     ` Pedro Alves
2008-05-02 11:51     ` Vladimir Prus
2008-05-02 13:24       ` Daniel Jacobowitz
2008-05-02 13:30         ` Vladimir Prus
2008-05-02 13:44           ` Daniel Jacobowitz
2008-05-02 15:33             ` Ulrich Weigand
2008-05-06 19:02               ` Pedro Alves
2008-05-02 13:51           ` Pedro Alves
2008-05-02 14:15             ` Vladimir Prus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox