[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH v2 11/15] gdbstub: add support for vA
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH v2 11/15] gdbstub: add support for vAttach packets |
Date: |
Mon, 1 Oct 2018 18:45:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
Hi Luc,
On 01/10/2018 13:57, Luc Michel wrote:
> Add support for the vAttach packets. In multiprocess mode, GDB sends
> them to attach to additional processes.
>
> Signed-off-by: Luc Michel <address@hidden>
> ---
> gdbstub.c | 32 ++++++++++++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
>
> diff --git a/gdbstub.c b/gdbstub.c
> index d372972dd3..b6de821025 100644
> --- a/gdbstub.c
> +++ b/gdbstub.c
> @@ -1326,10 +1326,42 @@ static int gdb_handle_packet(GDBState *s, const char
> *line_buf)
> break;
> }
> goto unknown_command;
> }
> break;
> + } else if (strncmp(p, "Attach", 6) == 0) {
Shouldn't this be strncmp("Attach;", 7)?
> + unsigned long pid;
> +
> + p += 7;
> +
> + qemu_strtoul(p, &p, 16, &pid);
You should check for EINVAL/ERANGE here.
Rest of the patch is OK.
> +
> + process = gdb_get_process(s, pid);
> +
> + if (process == NULL) {
> + put_packet(s, "E22");
> + break;
> + }
> +
> + cpu = get_first_cpu_in_process(s, process);
> +
> + if (cpu == NULL) {
> + /* Refuse to attach an empty process */
> + put_packet(s, "E22");
> + break;
> + }
> +
> + process->attached = true;
> +
> + s->g_cpu = cpu;
> + s->c_cpu = cpu;
> +
> + snprintf(buf, sizeof(buf), "T%02xthread:%s;", GDB_SIGNAL_TRAP,
> + gdb_fmt_thread_id(s, cpu, thread_id,
> sizeof(thread_id)));
> +
> + put_packet(s, buf);
> + break;
> } else {
> goto unknown_command;
> }
> case 'k':
> /* Kill the target */
>
- [Qemu-arm] [PATCH v2 07/15] gdbstub: add multiprocess support to Xfer:features:read:, (continued)
- [Qemu-arm] [PATCH v2 07/15] gdbstub: add multiprocess support to Xfer:features:read:, Luc Michel, 2018/10/01
- [Qemu-arm] [PATCH v2 05/15] gdbstub: add multiprocess support to 'sC' packets, Luc Michel, 2018/10/01
- [Qemu-arm] [PATCH v2 10/15] gdbstub: add support for extended mode packet, Luc Michel, 2018/10/01
- [Qemu-arm] [PATCH v2 01/15] gdbstub: introduce GDB processes, Luc Michel, 2018/10/01
- [Qemu-arm] [PATCH v2 11/15] gdbstub: add support for vAttach packets, Luc Michel, 2018/10/01
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 11/15] gdbstub: add support for vAttach packets,
Philippe Mathieu-Daudé <=
- [Qemu-arm] [PATCH v2 14/15] gdbstub: add multiprocess extension support, Luc Michel, 2018/10/01
- [Qemu-arm] [PATCH v2 15/15] arm/xlnx-zynqmp: put APUs and RPUs in separate GDB groups, Luc Michel, 2018/10/01
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 15/15] arm/xlnx-zynqmp: put APUs and RPUs in separate GDB groups, Philippe Mathieu-Daudé, 2018/10/02
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 15/15] arm/xlnx-zynqmp: put APUs and RPUs in separate GDB groups, Peter Maydell, 2018/10/02
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 15/15] arm/xlnx-zynqmp: put APUs and RPUs in separate GDB groups, Luc Michel, 2018/10/03
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 15/15] arm/xlnx-zynqmp: put APUs and RPUs in separate GDB groups, Philippe Mathieu-Daudé, 2018/10/04
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 15/15] arm/xlnx-zynqmp: put APUs and RPUs in separate GDB groups, Eduardo Habkost, 2018/10/04
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 15/15] arm/xlnx-zynqmp: put APUs and RPUs in separate GDB groups, Peter Maydell, 2018/10/04
- Re: [Qemu-arm] [Qemu-devel] [PATCH v2 15/15] arm/xlnx-zynqmp: put APUs and RPUs in separate GDB groups, Eduardo Habkost, 2018/10/04