Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: [patch] protocol doc vs. gdbserver on H and pPID.-1 etc. [Re: [patch 2/2] Fix watchpoints for multi-inferior #2]
Date: Thu, 26 Jan 2012 21:56:00 -0000	[thread overview]
Message-ID: <20120126215039.GA6943@host2.jankratochvil.net> (raw)
In-Reply-To: <4F205F3C.7090406@redhat.com>

On Wed, 25 Jan 2012 20:59:56 +0100, Pedro Alves wrote:
> Makes no sense setting the cont_thread to a process wildcard, there's no
> such thing in the protocol.  So this brings in a variant of your patch,
> that fixes it early on, instead of late in the target, along with clearing
> cont_thread on vRun.

This behavior matches what what does gdbserver for the `H' packet - it also
does not recognize pPID.-1.

But gdb.texinfo implicitly says pPID.-1 should be recognized as pPID but that
does not correspond to what gdbserver does.

So I made somehow doc <-> gdbserver in sync and made it all more clear.
Do you agree with it this way?


(I do not think that patch of yours / idea of it comes from me, feel free to
even remove my credit but I am also fine with the credit kept there.)


No regressions on {x86_64,x86_64-m32,i686}-fedorarawhide-linux-gnu in
gdbserver mode.


Thanks,
Jan


gdb/doc/
2012-01-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.texinfo (Packets): Document values for the `H' packet.
	Deprecate `Hc'.

gdb/gdbserver/
2012-01-26  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* server.c (cont_thread): New comment for it.
	(process_serial_event): Handle pPID.-1 values for 'H'.

--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -33798,7 +33798,13 @@ it should be @samp{c} for step and continue operations (note that this
 is deprecated, supporting the @samp{vCont} command is a better
 option), @samp{g} for other operations.  The thread designator
 @var{thread-id} has the format and interpretation described in
-@ref{thread-id syntax}.
+@ref{thread-id syntax} - value @samp{0} will act like @samp{-1} - to
+choose all threads of all inferiors.  @samp{pPID} (or equivalent
+@samp{pPID.-1}) means to choose any single thread of that @samp{PID}.
+It does not mean all threads of that @samp{PID} process - use
+@samp{vCont} packet instead in such case.
+
+Use of @samp{Hc} is deprecated in favor of @xref{vCont packet}.
 
 Reply:
 @table @samp
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -29,7 +29,15 @@
 #include <sys/wait.h>
 #endif
 
+/* Deprecated.  See gdb.texinfo description of the `Hc' packet - use
+   'vCont' packet instead.  It can be null_ptid for no inferior,
+   minus_one_ptid for resuming all inferior or a specific thread ptid_t.
+   Particularly process wildcard (pid > 0 && lwp == -1) for resuming
+   whole one inferior is not supported.  This variable is provided only
+   for backward compatibility with both clients and backend, backend
+   'resume' method supports process wildcards instead.  */
 ptid_t cont_thread;
+
 ptid_t general_thread;
 
 int server_waiting;
@@ -2980,8 +2988,8 @@ process_serial_event (void)
 	      || ptid_equal (gdb_id, minus_one_ptid))
 	    thread_id = null_ptid;
 	  else if (pid != 0
-		   && ptid_equal (pid_to_ptid (pid),
-				  gdb_id))
+		   && (ptid_equal (pid_to_ptid (pid), gdb_id)
+		       || ptid_equal (ptid_build (pid, -1, 0), gdb_id)))
 	    {
 	      struct thread_info *thread =
 		(struct thread_info *) find_inferior (&all_threads,


  reply	other threads:[~2012-01-26 21:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-02 16:47 [patch 2/2] Fix watchpoints for multi-inferior Jan Kratochvil
2012-01-02 19:14 ` Pedro Alves
2012-01-20 21:34   ` [patch 2/2] Fix watchpoints for multi-inferior #2 Jan Kratochvil
2012-01-24 13:40     ` Pedro Alves
2012-01-24 14:20       ` [commit] " Jan Kratochvil
2012-01-25 15:57       ` Jan Kratochvil
2012-01-25 17:54         ` Pedro Alves
2012-01-25 18:22           ` Pedro Alves
2012-01-25 20:08             ` Pedro Alves
2012-01-26 21:56               ` Jan Kratochvil [this message]
2012-01-27 11:53                 ` [patch] protocol doc vs. gdbserver on H and pPID.-1 etc. [Re: [patch 2/2] Fix watchpoints for multi-inferior #2] Pedro Alves
2012-01-27 12:02                 ` Pedro Alves
2012-03-16 20:11               ` [patch 2/2] Fix watchpoints for multi-inferior #2 Pedro Alves
2012-03-16 20:14                 ` Jan Kratochvil

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=20120126215039.GA6943@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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