diff --git a/qemu/target/arm/cpu.h b/qemu/target/arm/cpu.h index a4ed8d7f..5aba3f2c 100644 --- a/qemu/target/arm/cpu.h +++ b/qemu/target/arm/cpu.h @@ -62,7 +62,7 @@ #define EXCP_SEMIHOST 16 /* semihosting call */ #define EXCP_NOCP 17 /* v7M NOCP UsageFault */ #define EXCP_INVSTATE 18 /* v7M INVSTATE UsageFault */ -/* NB: new EXCP_ defines should be added to the excnames[] array too */ +/* NB: add new EXCP_ defines to the array in arm_log_exception() too */ #define ARMV7M_EXCP_RESET 1 #define ARMV7M_EXCP_NMI 2 diff --git a/qemu/target/arm/helper.c b/qemu/target/arm/helper.c index a9e959da..e6e1784f 100644 --- a/qemu/target/arm/helper.c +++ b/qemu/target/arm/helper.c @@ -5384,6 +5384,27 @@ static void arm_log_exception(int idx) { if (qemu_loglevel_mask(CPU_LOG_INT)) { const char *exc = NULL; + static const char * const excnames[] = { + NULL, + "Undefined Instruction", + "SVC", + "Prefetch Abort", + "Data Abort", + "IRQ", + "FIQ", + "Breakpoint", + "QEMU v7M exception exit", + "QEMU intercept of kernel commpage", + NULL, + "Hypervisor Call", + "Hypervisor Trap", + "Secure Monitor Call", + "Virtual IRQ", + "Virtual FIQ", + "Semihosting call", + "v7M NOCP UsageFault", + "v7M INVSTATE UsageFault", + }; if (idx >= 0 && idx < ARRAY_SIZE(excnames)) { exc = excnames[idx]; diff --git a/qemu/target/arm/internals.h b/qemu/target/arm/internals.h index 8360421b..90a5e6e2 100644 --- a/qemu/target/arm/internals.h +++ b/qemu/target/arm/internals.h @@ -51,31 +51,6 @@ static inline bool excp_is_internal(int excp) || excp == EXCP_SEMIHOST; } -/* Exception names for debug logging; note that not all of these - * precisely correspond to architectural exceptions. - */ -static const char * const excnames[] = { - NULL, - "Undefined Instruction", - "SVC", - "Prefetch Abort", - "Data Abort", - "IRQ", - "FIQ", - "Breakpoint", - "QEMU v7M exception exit", - "QEMU intercept of kernel commpage", - NULL, - "Hypervisor Call", - "Hypervisor Trap", - "Secure Monitor Call", - "Virtual IRQ", - "Virtual FIQ", - "Semihosting call", - "v7M NOCP UsageFault", - "v7M INVSTATE UsageFault", -}; - /* Scale factor for generic timers, ie number of ns per tick. * This gives a 62.5MHz timer. */