Debugger Expressions: Add FPU registers to breakpoint conditionals.

This commit is contained in:
Ty Lamontagne 2024-07-03 13:48:56 -04:00 committed by lightningterror
parent 28f7860af0
commit 06c9c60717
2 changed files with 19 additions and 3 deletions

View File

@ -55,12 +55,18 @@ public:
{
char reg[8];
std::snprintf(reg, std::size(reg), "r%d", i);
if (StringUtil::Strcasecmp(str, reg) == 0 || StringUtil::Strcasecmp(str, cpu->getRegisterName(0, i)) == 0)
{
referenceIndex = i;
return true;
}
std::snprintf(reg, std::size(reg), "f%d", i);
if (StringUtil::Strcasecmp(str, reg) == 0)
{
referenceIndex = i | REF_INDEX_FPU;
return true;
}
}
if (StringUtil::Strcasecmp(str, "pc") == 0)
@ -145,6 +151,10 @@ public:
}
return 0;
}
if (referenceIndex & REF_INDEX_FPU)
{
return cpu->getRegister(EECAT_FPR, referenceIndex & 0x1F)._u64[0];
}
return -1;
}

View File

@ -539,10 +539,16 @@ bool parsePostfixExpression(PostfixExpression& exp, IExpressionFunctions* funcs,
valueStack.push_back(arg[1]<arg[0]);
break;
case EXOP_EQUAL: // a == b
valueStack.push_back(arg[1]==arg[0]);
if (useFloat)
valueStack.push_back(fArg[1] == fArg[0]);
else
valueStack.push_back(arg[1]==arg[0]);
break;
case EXOP_NOTEQUAL: // a != b
valueStack.push_back(arg[1]!=arg[0]);
if (useFloat)
valueStack.push_back(fArg[1] != fArg[0]);
else
valueStack.push_back(arg[1]!=arg[0]);
break;
case EXOP_BITAND: // a&b
valueStack.push_back(arg[1]&arg[0]);