debugger: Add the XER to the register view
This commit is contained in:
parent
05b67c7f7c
commit
b7fdf374e6
|
@ -39,9 +39,9 @@ enum
|
||||||
IDM_VIEW_INT
|
IDM_VIEW_INT
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr const char* special_reg_names[] = {"PC", "LR", "CTR", "CR", "FPSCR",
|
constexpr const char* special_reg_names[] = {
|
||||||
"MSR", "SRR0", "SRR1", "Exceptions", "Int Mask",
|
"PC", "LR", "CTR", "CR", "XER", "FPSCR", "MSR", "SRR0",
|
||||||
"Int Cause", "DSISR", "DAR", "PT hashmask"};
|
"SRR1", "Exceptions", "Int Mask", "Int Cause", "DSISR", "DAR", "PT hashmask"};
|
||||||
|
|
||||||
wxString GetFormatString(CRegTable::FormatSpecifier specifier)
|
wxString GetFormatString(CRegTable::FormatSpecifier specifier)
|
||||||
{
|
{
|
||||||
|
@ -77,24 +77,26 @@ u32 GetSpecialRegValue(int reg)
|
||||||
case 3:
|
case 3:
|
||||||
return GetCR();
|
return GetCR();
|
||||||
case 4:
|
case 4:
|
||||||
return PowerPC::ppcState.fpscr;
|
return GetXER().Hex;
|
||||||
case 5:
|
case 5:
|
||||||
return PowerPC::ppcState.msr;
|
return PowerPC::ppcState.fpscr;
|
||||||
case 6:
|
case 6:
|
||||||
return PowerPC::ppcState.spr[SPR_SRR0];
|
return PowerPC::ppcState.msr;
|
||||||
case 7:
|
case 7:
|
||||||
return PowerPC::ppcState.spr[SPR_SRR1];
|
return PowerPC::ppcState.spr[SPR_SRR0];
|
||||||
case 8:
|
case 8:
|
||||||
return PowerPC::ppcState.Exceptions;
|
return PowerPC::ppcState.spr[SPR_SRR1];
|
||||||
case 9:
|
case 9:
|
||||||
return ProcessorInterface::GetMask();
|
return PowerPC::ppcState.Exceptions;
|
||||||
case 10:
|
case 10:
|
||||||
return ProcessorInterface::GetCause();
|
return ProcessorInterface::GetMask();
|
||||||
case 11:
|
case 11:
|
||||||
return PowerPC::ppcState.spr[SPR_DSISR];
|
return ProcessorInterface::GetCause();
|
||||||
case 12:
|
case 12:
|
||||||
return PowerPC::ppcState.spr[SPR_DAR];
|
return PowerPC::ppcState.spr[SPR_DSISR];
|
||||||
case 13:
|
case 13:
|
||||||
|
return PowerPC::ppcState.spr[SPR_DAR];
|
||||||
|
case 14:
|
||||||
return (PowerPC::ppcState.pagetable_hashmask << 6) | PowerPC::ppcState.pagetable_base;
|
return (PowerPC::ppcState.pagetable_hashmask << 6) | PowerPC::ppcState.pagetable_base;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -118,31 +120,34 @@ void SetSpecialRegValue(int reg, u32 value)
|
||||||
SetCR(value);
|
SetCR(value);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
PowerPC::ppcState.fpscr = value;
|
SetXER(UReg_XER(value));
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
PowerPC::ppcState.msr = value;
|
PowerPC::ppcState.fpscr = value;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
PowerPC::ppcState.spr[SPR_SRR0] = value;
|
PowerPC::ppcState.msr = value;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
PowerPC::ppcState.spr[SPR_SRR1] = value;
|
PowerPC::ppcState.spr[SPR_SRR0] = value;
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
|
PowerPC::ppcState.spr[SPR_SRR1] = value;
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
PowerPC::ppcState.Exceptions = value;
|
PowerPC::ppcState.Exceptions = value;
|
||||||
break;
|
break;
|
||||||
// Should we just change the value, or use ProcessorInterface::SetInterrupt() to make the system
|
// Should we just change the value, or use ProcessorInterface::SetInterrupt() to make the system
|
||||||
// aware?
|
// aware?
|
||||||
// case 9: return ProcessorInterface::GetMask();
|
// case 10: return ProcessorInterface::GetMask();
|
||||||
// case 10: return ProcessorInterface::GetCause();
|
// case 11: return ProcessorInterface::GetCause();
|
||||||
case 11:
|
case 12:
|
||||||
PowerPC::ppcState.spr[SPR_DSISR] = value;
|
PowerPC::ppcState.spr[SPR_DSISR] = value;
|
||||||
break;
|
break;
|
||||||
case 12:
|
case 13:
|
||||||
PowerPC::ppcState.spr[SPR_DAR] = value;
|
PowerPC::ppcState.spr[SPR_DAR] = value;
|
||||||
break;
|
break;
|
||||||
// case 13: (PowerPC::ppcState.pagetable_hashmask << 6) | PowerPC::ppcState.pagetable_base;
|
// case 14: (PowerPC::ppcState.pagetable_hashmask << 6) | PowerPC::ppcState.pagetable_base;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
// LR
|
// LR
|
||||||
// CTR
|
// CTR
|
||||||
// CR0-7
|
// CR0-7
|
||||||
|
// XER
|
||||||
// FPSCR
|
// FPSCR
|
||||||
// MSR
|
// MSR
|
||||||
// SRR0
|
// SRR0
|
||||||
|
@ -51,7 +52,7 @@ public:
|
||||||
void UpdateCachedRegs();
|
void UpdateCachedRegs();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static constexpr int NUM_SPECIALS = 14;
|
static constexpr int NUM_SPECIALS = 15;
|
||||||
|
|
||||||
std::array<u32, 32> m_CachedRegs{};
|
std::array<u32, 32> m_CachedRegs{};
|
||||||
std::array<u32, NUM_SPECIALS> m_CachedSpecialRegs{};
|
std::array<u32, NUM_SPECIALS> m_CachedSpecialRegs{};
|
||||||
|
|
Loading…
Reference in New Issue