From 0368d8d189af0444cd818f4f695beb1d94706f44 Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Tue, 21 Jan 2025 12:11:35 +0100 Subject: gdbstub: Prefer cached CpuClass over CPU_GET_CLASS() macro MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CpuState caches its CPUClass since commit 6fbdff87062 ("cpu: cache CPUClass in CPUState for hot code paths"), use it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Acked-by: Alex Bennée Message-Id: <20250122093028.52416-9-philmd@linaro.org> --- gdbstub/user.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'gdbstub/user.c') diff --git a/gdbstub/user.c b/gdbstub/user.c index 3730f32c41..67403e5a25 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -743,11 +743,8 @@ int gdb_continue_partial(char *newstates) int gdb_target_memory_rw_debug(CPUState *cpu, hwaddr addr, uint8_t *buf, int len, bool is_write) { - CPUClass *cc; - - cc = CPU_GET_CLASS(cpu); - if (cc->memory_rw_debug) { - return cc->memory_rw_debug(cpu, addr, buf, len, is_write); + if (cpu->cc->memory_rw_debug) { + return cpu->cc->memory_rw_debug(cpu, addr, buf, len, is_write); } return cpu_memory_rw_debug(cpu, addr, buf, len, is_write); } -- cgit 1.4.1