qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Luc Michel <luc.michel@greensocs.com>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
	"Edgar E . Iglesias" <edgar.iglesias@xilinx.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	"Mark Burton" <mark.burton@greensocs.com>
Subject: Re: [Qemu-devel] [PATCH] gdbstub: fix gdb_get_cpu(s, pid, tid) when pid and/or tid are 0
Date: Mon, 21 Jan 2019 13:53:55 +0000	[thread overview]
Message-ID: <CAFEAcA8h+rX_v+BBuhCr0t1sPSg56CsTnVGteFV5mgYa7HYJMw@mail.gmail.com> (raw)
In-Reply-To: <20190119140000.11767-1-luc.michel@greensocs.com>

On Sat, 19 Jan 2019 at 14:00, Luc Michel <luc.michel@greensocs.com> wrote:
>
> a TID or PID value means "any thread" (resp. "any process"). This commit
> fixes the different combinations when at least one value is 0.
>
> When both are 0, the function now returns the first attached CPU,
> instead of the CPU with TID 1, which is not necessarily attached or even
> existent.
>
> When PID is specified but TID is 0, the function returns the first CPU
> in the process, or NULL if the process does not exist or is not
> attached.
>
> In other cases, it returns the corresponding CPU, while ignoring the PID
> check when PID is 0.
>
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Luc Michel <luc.michel@greensocs.com>
> ---

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

I've tracked down why my code was running into this, incidentally:
it turned out to be because I wasn't getting the parenting of the CPU
objects into the container correct, so the gdbstub ended up with
three processes, of which the first two were empty (and the CPUs
in the third default process). So the first thread (cpu 0) wasn't
in the first process, but in the last one.


thanks
-- PMM

  reply	other threads:[~2019-01-21 13:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-19 14:00 [Qemu-devel] [PATCH] gdbstub: fix gdb_get_cpu(s, pid, tid) when pid and/or tid are 0 Luc Michel
2019-01-21 13:53 ` Peter Maydell [this message]
2019-01-21 16:15   ` Peter Maydell

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=CAFEAcA8h+rX_v+BBuhCr0t1sPSg56CsTnVGteFV5mgYa7HYJMw@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=luc.michel@greensocs.com \
    --cc=mark.burton@greensocs.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).