Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] Make continuations per-thread.
Date: Thu, 24 Apr 2008 23:08:00 -0000	[thread overview]
Message-ID: <200804242045.39246.vladimir@codesourcery.com> (raw)


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


             reply	other threads:[~2008-04-24 16:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24 23:08 Vladimir Prus [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200804242045.39246.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox