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-target.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gdbstub/user-target.c') diff --git a/gdbstub/user-target.c b/gdbstub/user-target.c index 4bfcf78aaa..43231e695e 100644 --- a/gdbstub/user-target.c +++ b/gdbstub/user-target.c @@ -233,10 +233,8 @@ void gdb_handle_query_offsets(GArray *params, void *user_ctx) static inline int target_memory_rw_debug(CPUState *cpu, target_ulong 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