gdbstub: add multiprocess support to 'H' and 'T' packets
commit7d8c87da79c23b2caa8f68a0a9cd0b15cedf8b41
authorLuc Michel <luc.michel@greensocs.com>
Mon, 7 Jan 2019 15:23:45 +0000 (7 15:23 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 7 Jan 2019 15:23:45 +0000 (7 15:23 +0000)
tree2f60ef8f11a0c9e3e43510d18b96d4cc4072e971
parent1a2273369725111a2bbdb602ca7c679d466618b0
gdbstub: add multiprocess support to 'H' and 'T' packets

Add a couple of helper functions to cope with GDB threads and processes.

The gdb_get_process() function looks for a process given a pid.

The gdb_get_cpu() function returns the CPU corresponding to the (pid,
tid) pair given as parameters.

The read_thread_id() function parses the thread-id sent by the peer.
This function supports the multiprocess extension thread-id syntax.  The
return value specifies if the parsing failed, or if a special case was
encountered (all processes or all threads).

Use them in 'H' and 'T' packets handling to support the multiprocess
extension.

Signed-off-by: Luc Michel <luc.michel@greensocs.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20181207090135.7651-5-luc.michel@greensocs.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
gdbstub.c