On 10/7/2026 2:44 AM, Philippe Mathieu-Daudé wrote:
> Add qemu_excp_name() to resolve QEMU internal exception
> values.
>
> Add a common CPUClass::exception_name() callback so the
> generic exception logger can resolve architecture-specific
> exception values to human-readable names.
>
> Re-use existing methods (expose prototype or refactor) when
> available otherwise implement new ones (AVR, X86, MicroBlaze,
> S390x, TriCore and Xtensa).
>
> This series is the base for consolidating exception management
> in accel/tcg/ (more series to be posted on top).
>
Overall, that's a nice series, and would be a great addition.
The only general suggestion, that applies to most of patches, would be
to factorize the following pattern:
```
if (excp < 0 || excp >= ARRAY_SIZE(excnames) || !excnames[excp]) {
return "unknown";
else {
return excnamed[excp];
}
```
by defining a macro:
```
#define STR_ARRAY_INDEX(array, index) \
(index < 0 || index >= ARRAY_SIZE(array) ? NULL : array[index])
```
```
const char *excp = STR_ARRAY_INDEX(excnames, excp);
return excp ? excp : "unknown";
```
Regards,
Pierrick