]> git.ipfire.org Git - thirdparty/qemu.git/commit
gdbstub: add multiprocess support to '?' packets
authorLuc Michel <luc.michel@greensocs.com>
Mon, 7 Jan 2019 15:23:45 +0000 (15:23 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 7 Jan 2019 15:23:45 +0000 (15:23 +0000)
commit1a2273369725111a2bbdb602ca7c679d466618b0
tree333f59d8f614d91168902f369f5f76a395cd9ec0
parent8f468636189303358da3b365c53cb03ae5497eca
gdbstub: add multiprocess support to '?' packets

The gdb_get_cpu_pid() function does the PID lookup for the given CPU. It
checks if the CPU is a direct child of a CPU cluster. If it is, the
returned PID is the cluster ID plus one (cluster IDs start at 0, GDB
PIDs at 1). When the CPU is not a child of such a container, the PID of
the default process is returned.

The gdb_fmt_thread_id() function generates the string to be used to identify
a given thread, in a response packet for the peer. This function
supports generating thread IDs when multiprocess mode is enabled (in the
form `p<pid>.<tid>').

Use them in the reply to a '?' request.

Signed-off-by: Luc Michel <luc.michel@greensocs.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Message-id: 20181207090135.7651-4-luc.michel@greensocs.com
[PMM: fixed checkpatch blockquote style nit]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
gdbstub.c