Skip to content

Commit ea694bf

Browse files
committed
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 c23a5cc for more details.
1 parent 9b4f2b4 commit ea694bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/std/debug/cpu_context.zig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,19 +322,24 @@ const Arm = struct {
322322
131 => return error.UnsupportedRegister, // SPSR_ABT
323323
132 => return error.UnsupportedRegister, // SPSR_UND
324324
133 => return error.UnsupportedRegister, // SPSR_SVC
325+
134...142 => return error.UnsupportedRegister, // Reserved
325326
143 => return error.UnsupportedRegister, // RA_AUTH_CODE
326327
144...150 => return error.UnsupportedRegister, // R8_USR - R14_USR
327328
151...157 => return error.UnsupportedRegister, // R8_FIQ - R14_FIQ
328329
158...159 => return error.UnsupportedRegister, // R13_IRQ - R14_IRQ
329330
160...161 => return error.UnsupportedRegister, // R13_ABT - R14_ABT
330331
162...163 => return error.UnsupportedRegister, // R13_UND - R14_UND
331332
164...165 => return error.UnsupportedRegister, // R13_SVC - R14_SVC
333+
166...191 => return error.UnsupportedRegister, // Reserved
332334
192...199 => return error.UnsupportedRegister, // wC0 - wC7
335+
200...255 => return error.UnsupportedRegister, // Reserved
333336
256...287 => return error.UnsupportedRegister, // D0 - D31
337+
288...319 => return error.UnsupportedRegister, // Reserved for FP/NEON
334338
320 => return error.UnsupportedRegister, // TPIDRURO
335339
321 => return error.UnsupportedRegister, // TPIDRURW
336340
322 => return error.UnsupportedRegister, // TPIDPR
337341
323 => return error.UnsupportedRegister, // HTPIDPR
342+
324...8191 => return error.UnsupportedRegister, // Reserved
338343
8192...16383 => return error.UnsupportedRegister, // Unspecified vendor co-processor register
339344

340345
else => return error.InvalidRegister,
@@ -393,6 +398,7 @@ const Aarch64 = extern struct {
393398
37 => return error.UnsupportedRegister, // TPIDR_EL1
394399
38 => return error.UnsupportedRegister, // TPIDR_EL2
395400
39 => return error.UnsupportedRegister, // TPIDR_EL3
401+
40...45 => return error.UnsupportedRegister, // Reserved
396402
46 => return error.UnsupportedRegister, // VG
397403
47 => return error.UnsupportedRegister, // FFR
398404
48...63 => return error.UnsupportedRegister, // P0 - P15

0 commit comments

Comments
 (0)