authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-12 02:36:40+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-10-12 12:59:06+02:00
logea694bfdb762a4dd18654c73aaaaf1b917d99cc3
tree3aa1ecb92b5fc4a24e306a13368302c472e49d94
parent9b4f2b40e36a2b59d0550e22f7b3fcfc06d70135

std.debug.cpu_context: consider arm and aarch64 reserved register ranges unsupported

If these ever get allocated, it's most likely going to be for things that don't matter to us anyway, so completely abandoning DWARF unwinding just because we see these doesn't seem justified. We will still do so if we're actually asked to read from such a register, which is the only actually problematic case; see c23a5ccd19 for more details.

1 files changed, 6 insertions(+), 0 deletions(-)

lib/std/debug/cpu_context.zig+6
...@@ -322,6 +322,7 @@ const Arm = struct {...@@ -322,6 +322,7 @@ const Arm = struct {
322 131 => return error.UnsupportedRegister, // SPSR_ABT322 131 => return error.UnsupportedRegister, // SPSR_ABT
323 132 => return error.UnsupportedRegister, // SPSR_UND323 132 => return error.UnsupportedRegister, // SPSR_UND
324 133 => return error.UnsupportedRegister, // SPSR_SVC324 133 => return error.UnsupportedRegister, // SPSR_SVC
325 134...142 => return error.UnsupportedRegister, // Reserved
325 143 => return error.UnsupportedRegister, // RA_AUTH_CODE326 143 => return error.UnsupportedRegister, // RA_AUTH_CODE
326 144...150 => return error.UnsupportedRegister, // R8_USR - R14_USR327 144...150 => return error.UnsupportedRegister, // R8_USR - R14_USR
327 151...157 => return error.UnsupportedRegister, // R8_FIQ - R14_FIQ328 151...157 => return error.UnsupportedRegister, // R8_FIQ - R14_FIQ
...@@ -329,12 +330,16 @@ const Arm = struct {...@@ -329,12 +330,16 @@ const Arm = struct {
329 160...161 => return error.UnsupportedRegister, // R13_ABT - R14_ABT330 160...161 => return error.UnsupportedRegister, // R13_ABT - R14_ABT
330 162...163 => return error.UnsupportedRegister, // R13_UND - R14_UND331 162...163 => return error.UnsupportedRegister, // R13_UND - R14_UND
331 164...165 => return error.UnsupportedRegister, // R13_SVC - R14_SVC332 164...165 => return error.UnsupportedRegister, // R13_SVC - R14_SVC
333 166...191 => return error.UnsupportedRegister, // Reserved
332 192...199 => return error.UnsupportedRegister, // wC0 - wC7334 192...199 => return error.UnsupportedRegister, // wC0 - wC7
335 200...255 => return error.UnsupportedRegister, // Reserved
333 256...287 => return error.UnsupportedRegister, // D0 - D31336 256...287 => return error.UnsupportedRegister, // D0 - D31
337 288...319 => return error.UnsupportedRegister, // Reserved for FP/NEON
334 320 => return error.UnsupportedRegister, // TPIDRURO338 320 => return error.UnsupportedRegister, // TPIDRURO
335 321 => return error.UnsupportedRegister, // TPIDRURW339 321 => return error.UnsupportedRegister, // TPIDRURW
336 322 => return error.UnsupportedRegister, // TPIDPR340 322 => return error.UnsupportedRegister, // TPIDPR
337 323 => return error.UnsupportedRegister, // HTPIDPR341 323 => return error.UnsupportedRegister, // HTPIDPR
342 324...8191 => return error.UnsupportedRegister, // Reserved
338 8192...16383 => return error.UnsupportedRegister, // Unspecified vendor co-processor register343 8192...16383 => return error.UnsupportedRegister, // Unspecified vendor co-processor register
339344
340 else => return error.InvalidRegister,345 else => return error.InvalidRegister,
...@@ -393,6 +398,7 @@ const Aarch64 = extern struct {...@@ -393,6 +398,7 @@ const Aarch64 = extern struct {
393 37 => return error.UnsupportedRegister, // TPIDR_EL1398 37 => return error.UnsupportedRegister, // TPIDR_EL1
394 38 => return error.UnsupportedRegister, // TPIDR_EL2399 38 => return error.UnsupportedRegister, // TPIDR_EL2
395 39 => return error.UnsupportedRegister, // TPIDR_EL3400 39 => return error.UnsupportedRegister, // TPIDR_EL3
401 40...45 => return error.UnsupportedRegister, // Reserved
396 46 => return error.UnsupportedRegister, // VG402 46 => return error.UnsupportedRegister, // VG
397 47 => return error.UnsupportedRegister, // FFR403 47 => return error.UnsupportedRegister, // FFR
398 48...63 => return error.UnsupportedRegister, // P0 - P15404 48...63 => return error.UnsupportedRegister, // P0 - P15