[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] gdbstub: fix gdb_get_cpu(s, pid, tid) when pid
From: |
Peter Maydell |
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 16:15:33 +0000 |
On Mon, 21 Jan 2019 at 13:53, Peter Maydell <address@hidden> wrote:
>
> On Sat, 19 Jan 2019 at 14:00, Luc Michel <address@hidden> 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 <address@hidden>
> > Signed-off-by: Luc Michel <address@hidden>
> > ---
>
> Reviewed-by: Peter Maydell <address@hidden>
>
> 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.
Applied to target-arm.next, thanks.
-- PMM