From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/remote: Don't use vKill if multi-process features are disabled
Date: Fri, 18 Mar 2016 06:28:00 -0000 [thread overview]
Message-ID: <20160318062747.GZ14100@embecosm.com> (raw)
In-Reply-To: <56EB4806.7070505@redhat.com>
* Pedro Alves <palves@redhat.com> [2016-03-18 00:12:54 +0000]:
> On 03/17/2016 11:26 PM, Andrew Burgess wrote:
>
> > The gdb remote protocol documentation is clear that the vKill command
> > should not be used unless the multi-process feature is reported as
> > supported by the remote target.
>
> Sorry, you were too fast... :-/
>
> I recalled a reason to keep it. The original reason for the docs saying
> that is that vKill includes a PID, and without multi-process extensions,
> there's no known non-fake PID to send. (GDB is presently sending a
> fake PID, as you've probably noticed).
>
> The other-than-the-pid advantage of vKill over "k", is that "k" has
> no reply, and thus no way to return error, failure to kill, etc.
>
> Note gdbserver is making use of vKill with multi-process off:
>
> /* Kill process. Return 1 if successful, 0 if failure. */
> static int
> handle_v_kill (char *own_buf)
> {
> int pid;
> char *p = &own_buf[6];
> if (multi_process)
> pid = strtol (p, NULL, 16);
> else
> pid = signal_pid;
> if (pid != 0 && kill_inferior (pid) == 0)
>
> So we could just not include the "pid" part if multi-process
> is off, similar to D vs D;pid. We'd still need the ";", due
> to gdbserver's:
>
> if (startswith (own_buf, "vKill;"))
> {
OK, armed with this new insight I read the docs again, and now I see
that indeed my initial interpretation was not correct. I see if I can
come up with a wording that feels clearer.
Thank you for setting me straight.
Andrew
prev parent reply other threads:[~2016-03-18 6:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-17 22:03 Andrew Burgess
2016-03-17 22:21 ` Pedro Alves
2016-03-17 23:27 ` Andrew Burgess
2016-03-18 0:12 ` Pedro Alves
2016-03-18 6:28 ` Andrew Burgess [this message]
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=20160318062747.GZ14100@embecosm.com \
--to=andrew.burgess@embecosm.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