[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 18/24] gdbstub: don't use target_ulong while handling regi
From: |
Richard Henderson |
Subject: |
Re: [PATCH v3 18/24] gdbstub: don't use target_ulong while handling registers |
Date: |
Tue, 21 Feb 2023 14:51:02 -1000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 |
On 2/21/23 12:52, Alex Bennée wrote:
This is a hangover from the original code. addr is misleading as it is
only really a register id. While len will never exceed
MAX_PACKET_LENGTH I've used size_t as that is what strlen returns.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
v3
- fix commit message
- use unsigned for regid
Don't use unsigned, which you did here:
static void handle_write_all_regs(GArray *params, void *user_ctx)
{
- target_ulong addr, len;
+ unsigned int reg_id;
but not here
static void handle_read_all_regs(GArray *params, void *user_ctx)
{
- target_ulong addr, len;
+ int reg_id;
because the comparison,
+ for (reg_id = 0; reg_id < gdbserver_state.g_cpu->gdb_num_g_regs; reg_id++)
{
is against signed:
include/hw/core/cpu.h:377: int gdb_num_g_regs;
r~
- Re: [PATCH v3 09/24] gdbstub: move chunk of softmmu functionality to own file, (continued)
- [PATCH v3 23/24] include: split target_long definition from cpu-defs, Alex Bennée, 2023/02/21
- [PATCH v3 10/24] gdbstub: move chunks of user code into own files, Alex Bennée, 2023/02/21
- [PATCH v3 15/24] gdbstub: introduce gdb_get_max_cpus, Alex Bennée, 2023/02/21
- [PATCH v3 13/24] gdbstub: specialise handle_query_attached, Alex Bennée, 2023/02/21
- [PATCH v3 24/24] gdbstub: split out softmmu/user specifics for syscall handling, Alex Bennée, 2023/02/21
- [PATCH v3 12/24] gdbstub: abstract target specific details from gdb_put_packet_binary, Alex Bennée, 2023/02/21
- [PATCH v3 18/24] gdbstub: don't use target_ulong while handling registers, Alex Bennée, 2023/02/21
- Re: [PATCH v3 18/24] gdbstub: don't use target_ulong while handling registers,
Richard Henderson <=
- [PATCH v3 22/24] testing: probe gdb for supported architectures ahead of time, Alex Bennée, 2023/02/21
- [PATCH v3 20/24] gdbstub: move syscall handling to new file, Alex Bennée, 2023/02/21
- [PATCH v3 17/24] gdbstub: fix address type of gdb_set_cpu_pc, Alex Bennée, 2023/02/21
- [PATCH v3 14/24] gdbstub: specialise target_memory_rw_debug, Alex Bennée, 2023/02/21
- [PATCH v3 16/24] gdbstub: specialise stub_can_reverse, Alex Bennée, 2023/02/21
- [PATCH v3 21/24] gdbstub: only compile gdbstub twice for whole build, Alex Bennée, 2023/02/21
- [PATCH v3 19/24] gdbstub: move register helpers into standalone include, Alex Bennée, 2023/02/21