On 8/1/25 05:13, Pierrick Bouvier wrote:
On 7/27/25 1:02 AM, Richard Henderson wrote:
The ARM now defines 36 bits in SPSR_ELx in aarch64 mode, so
it's time to bite the bullet and extend PSTATE to match.
Most changes are straightforward, adjusting printf formats,
changing local variable types. More complex is migration,
where to maintain backward compatibility a new pstate64
record is introduced, and only when one of the extensions
that sets bits 32-35 are active.
The fate of gdbstub is left undecided for the moment.
...
diff --git a/target/arm/gdbstub64.c b/target/arm/gdbstub64.c
index 64ee9b3b56..3cef47281a 100644
--- a/target/arm/gdbstub64.c
+++ b/target/arm/gdbstub64.c
@@ -47,6 +47,7 @@ int aarch64_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf,
int n)
case 32:
return gdb_get_reg64(mem_buf, env->pc);
case 33:
+ /* pstate is now a 64-bit value; can we simply adjust the xml? */
return gdb_get_reg32(mem_buf, pstate_read(env));
}
If I'm correct, we currently don't expose PSTATE through gdbstub, but only CPSR. This was
a bit confusing for me, considering that CPSR is not even supposed to exist in Aarch64.
Correct. An old error, for sure.
Maybe it's a good opportunity to expose PSTATE instead, which could have a 64 bits size.
This way, we don't break any workflow.
Hmm, perhaps adding a "org.gnu.gdb.aarch64.pstate" xml with just one 64-bit value is the
best solution. Thiago?
r~