summary refs log tree commit diff stats
path: root/gdbstub/system.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-21 12:11:35 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-09 17:00:47 +0100
commit0368d8d189af0444cd818f4f695beb1d94706f44 (patch)
tree7873c2586d53ce6502fc594ea3a00e8673d5eb50 /gdbstub/system.c
parent4c5c410ceb4e039a49a120a436cc6183831a778b (diff)
downloadfocaccia-qemu-0368d8d189af0444cd818f4f695beb1d94706f44.tar.gz
focaccia-qemu-0368d8d189af0444cd818f4f695beb1d94706f44.zip
gdbstub: Prefer cached CpuClass over CPU_GET_CLASS() macro
CpuState caches its CPUClass since commit 6fbdff87062
("cpu: cache CPUClass in CPUState for hot code paths"),
use it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20250122093028.52416-9-philmd@linaro.org>
Diffstat (limited to 'gdbstub/system.c')
-rw-r--r--gdbstub/system.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdbstub/system.c b/gdbstub/system.c
index 416c1dbe1e..dd22ff0fb3 100644
--- a/gdbstub/system.c
+++ b/gdbstub/system.c
@@ -456,8 +456,6 @@ static int phy_memory_mode;
 int gdb_target_memory_rw_debug(CPUState *cpu, hwaddr addr,
                                uint8_t *buf, int len, bool is_write)
 {
-    CPUClass *cc;
-
     if (phy_memory_mode) {
         if (is_write) {
             cpu_physical_memory_write(addr, buf, len);
@@ -467,9 +465,8 @@ int gdb_target_memory_rw_debug(CPUState *cpu, hwaddr addr,
         return 0;
     }
 
-    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);