Skip to content

Commit

Permalink
Fix 32-bit exec on PKRU-capable x86 CPU
Browse files Browse the repository at this point in the history
Fixes the following in 32bit mode:
```
ExtraRegisters.cc:665: void rr::ExtraRegisters::reset(): Assertion `d.xsave_feature_bit == PKRU_FEATURE_BIT' failed.
```
  • Loading branch information
Keno authored and khuey committed Dec 18, 2021
1 parent b7cd6a3 commit f4529da
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/ExtraRegisters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,12 @@ static RegData xsave_register_data(SupportedArch arch, GdbRegister regno) {
regno = (GdbRegister)(regno - DREG_YMM0H + DREG_64_YMM0H);
break;
}
if (regno < DREG_FIRST_FXSAVE_REG || regno > DREG_LAST_FXSAVE_REG) {
return RegData();
}
if (regno == DREG_MXCSR) {
regno = DREG_64_MXCSR;
} else if (regno == DREG_PKRU) {
regno = DREG_64_PKRU;
} else if (regno < DREG_FIRST_FXSAVE_REG || regno > DREG_LAST_FXSAVE_REG) {
return RegData();
} else {
regno = (GdbRegister)(regno - DREG_FIRST_FXSAVE_REG +
DREG_64_FIRST_FXSAVE_REG);
Expand Down

0 comments on commit f4529da

Please sign in to comment.