gdbstub: extend GByteArray to read register helpers
Instead of passing a pointer to memory now just extend the GByteArray to all the read register helpers. They can then safely append their data through the normal way. We don't bother with this abstraction for write registers as we have already ensured the buffer being copied from is the correct size. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Acked-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Damien Hedde <damien.hedde@greensocs.com> Message-Id: <20200316172155.971-15-alex.bennee@linaro.org>
This commit is contained in:
@@ -202,7 +202,7 @@ void lm32_cpu_do_interrupt(CPUState *cpu);
|
||||
bool lm32_cpu_exec_interrupt(CPUState *cs, int int_req);
|
||||
void lm32_cpu_dump_state(CPUState *cpu, FILE *f, int flags);
|
||||
hwaddr lm32_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
|
||||
int lm32_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
|
||||
int lm32_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
|
||||
int lm32_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "exec/gdbstub.h"
|
||||
#include "hw/lm32/lm32_pic.h"
|
||||
|
||||
int lm32_cpu_gdb_read_register(CPUState *cs, uint8_t *mem_buf, int n)
|
||||
int lm32_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
|
||||
{
|
||||
LM32CPU *cpu = LM32_CPU(cs);
|
||||
CPULM32State *env = &cpu->env;
|
||||
|
||||
Reference in New Issue
Block a user