From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Kevin Pouget <kevin.pouget@gmail.com>
Subject: Re: [PATCH] GDB checkpoint can't/shouldn't be possible with multiple threads on Linux
Date: Tue, 12 Apr 2011 10:59:00 -0000 [thread overview]
Message-ID: <201104121159.06026.pedro@codesourcery.com> (raw)
In-Reply-To: <BANLkTi=pTUVx5iHkb0-0oZyKJHNbALY2SA@mail.gmail.com>
On Tuesday 12 April 2011 08:44:14, Kevin Pouget wrote:
> 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,
> (does such a patch require a test case?)
Tests are always good, tough I'd approve this without one.
> 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.
> +
Next time please post ChangeLog entries as plaintext,
separate from the patch.
> 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. */
Double space after periods.
> + update_thread_list () ;
> + if (thread_count () > 1)
> + error (_("checkpoint: can't checkpoint multiple threads.")) ;
You have spurious spaces before `;'.
thread_count() returns the sum total number of threads of all
inferiors/process. You want the number of threads of the
current process only. AFAIR, there's no function handy that
returns you that. (Since you're interested in checking for multiple
threads, you could use iterate_over_threads with a
callback that returns true if it sees a second thread for a
given process, so you don't really need to count all
the threads.)
--
Pedro Alves
next prev parent reply other threads:[~2011-04-12 10:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 7:44 Kevin Pouget
2011-04-12 10:59 ` Pedro Alves [this message]
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
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=201104121159.06026.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=kevin.pouget@gmail.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