File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
compiler-rt/lib/sanitizer_common Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -2312,11 +2312,11 @@ static const char *RegNumToRegName(int reg) {
2312
2312
return NULL ;
2313
2313
}
2314
2314
2315
- # if SANITIZER_LINUX && SANITIZER_GLIBC && \
2315
+ # if (( SANITIZER_LINUX && SANITIZER_GLIBC) || SANITIZER_NETBSD) && \
2316
2316
(defined (__arm__) || defined (__aarch64__))
2317
2317
static uptr GetArmRegister (ucontext_t *ctx, int RegNum) {
2318
2318
switch (RegNum) {
2319
- # if defined(__arm__)
2319
+ # if defined(__arm__) && !SANITIZER_NETBSD
2320
2320
# ifdef MAKE_CASE
2321
2321
# undef MAKE_CASE
2322
2322
# endif
@@ -2345,10 +2345,15 @@ static uptr GetArmRegister(ucontext_t *ctx, int RegNum) {
2345
2345
case REG_R15:
2346
2346
return ctx->uc_mcontext .arm_pc ;
2347
2347
# elif defined(__aarch64__)
2348
+ # if SANITIZER_LINUX
2348
2349
case 0 ... 30 :
2349
2350
return ctx->uc_mcontext .regs [RegNum];
2350
2351
case 31 :
2351
2352
return ctx->uc_mcontext .sp ;
2353
+ # elif SANITIZER_NETBSD
2354
+ case 0 ... 31 :
2355
+ return ctx->uc_mcontext .__gregs [RegNum];
2356
+ # endif
2352
2357
# endif
2353
2358
default :
2354
2359
return 0 ;
@@ -2456,7 +2461,7 @@ void SignalContext::DumpAllRegisters(void *context) {
2456
2461
DumpSingleReg (ucontext, REG_R14);
2457
2462
DumpSingleReg (ucontext, REG_R15);
2458
2463
Printf (" \n " );
2459
- # elif defined(__aarch64__) && !SANITIZER_NETBSD
2464
+ # elif defined(__aarch64__)
2460
2465
Report (" Register values:\n " );
2461
2466
for (int i = 0 ; i <= 31 ; ++i) {
2462
2467
DumpSingleReg (ucontext, i);
You can’t perform that action at this time.
0 commit comments