Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] GDB checkpoint can't/shouldn't be possible with multiple threads on Linux
@ 2011-04-12  7:44 Kevin Pouget
  2011-04-12 10:59 ` Pedro Alves
  0 siblings, 1 reply; 11+ messages in thread
From: Kevin Pouget @ 2011-04-12  7:44 UTC (permalink / raw)
  To: gdb-patches

Hello,

as I reported in http://sourceware.org/bugzilla/show_bug.cgi?id=12628
and discussed in http://sourceware.org/ml/gdb/2011-04/msg00018.html,
GDB can't handle properly the checkpointing of an application
currently running several threads without a dedicated support.


This patch updates the thread-list and check the thread count before
doing the actual checkpoint.


(does such a patch require a test case?)

Cordially,

Kevin

-----------


diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 880781a..611aa7e 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2011-04-12 Kevin Pouget <kevin.pouget@st.com>
+
+	PR threads/12628
+	* linux-fork.c (checkpoint_command): Disallow checkpointing of
+	processes with multiple threads.
+
 2011-03-29 Kevin Pouget <kevin.pouget@st.com>

 	Allow Python notification of new object-file loadings.
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index 7f654af..c137604 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -628,6 +628,11 @@ checkpoint_command (char *args, int from_tty)
   pid_t retpid;
   struct cleanup *old_chain;

+  /* Ensure that the inferior is not multithreaded. */
+  update_thread_list () ;
+  if (thread_count () > 1)
+    error (_("checkpoint: can't checkpoint multiple threads.")) ;
+
   /* Make the inferior fork, record its (and gdb's) state.  */

   if (lookup_minimal_symbol ("fork", NULL, NULL) != NULL)


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

end of thread, other threads:[~2011-09-15 12:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12  7:44 [PATCH] GDB checkpoint can't/shouldn't be possible with multiple threads on Linux Kevin Pouget
2011-04-12 10:59 ` Pedro Alves
2011-04-12 11:55   ` Kevin Pouget
2011-04-12 12:55     ` Pedro Alves
2011-04-12 13:28       ` Kevin Pouget
2011-04-12 13:36         ` Pedro Alves
2011-04-12 13:42         ` Pedro Alves
2011-04-12 13:55           ` Kevin Pouget
2011-08-31 12:45             ` Kevin Pouget
2011-09-06 14:42               ` Pedro Alves
2011-09-15 13:32                 ` Kevin Pouget

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