Since commit 3f940dc98, we added support for vAttach packet to select a particular thread/cpu/core. However when using the GDB physical memory mode, it is not clear which CPU address space is used. Since the CPU address space is stored in CPUState::as, use address_space_rw() instead of cpu_physical_memory_rw().
Fixes: ab4752ec8d9 Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org> --- gdbstub.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index 013fb1ac0f..3baaef50e3 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -69,11 +69,8 @@ static inline int target_memory_rw_debug(CPUState *cpu, target_ulong addr, #ifndef CONFIG_USER_ONLY if (phy_memory_mode) { - if (is_write) { - cpu_physical_memory_write(addr, buf, len); - } else { - cpu_physical_memory_read(addr, buf, len); - } + address_space_rw(cpu->as, addr, MEMTXATTRS_UNSPECIFIED, + buf, len, is_write); return 0; } #endif -- 2.21.1