Fix register window not updating in PPC debugger (#864)

This commit is contained in:
Chris Purnell 2023-06-17 12:50:40 +01:00 committed by GitHub
parent f0ef8f3cc2
commit 950e9564e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,7 +145,7 @@ void RegisterWindow::UpdateIntegerRegister(wxTextCtrl* label, wxTextCtrl* value,
else if (value->GetForegroundColour() != COLOR_BLACK) else if (value->GetForegroundColour() != COLOR_BLACK)
value->SetForegroundColour(COLOR_BLACK); value->SetForegroundColour(COLOR_BLACK);
value->SetLabelText(wxString::Format("%08x", registerValue)); value->ChangeValue(wxString::Format("%08x", registerValue));
//const auto label = dynamic_cast<wxTextCtrl*>(GetWindowChild(kRegisterLabelR0 + i)); //const auto label = dynamic_cast<wxTextCtrl*>(GetWindowChild(kRegisterLabelR0 + i));
//wxASSERT(label); //wxASSERT(label);
@ -177,7 +177,7 @@ void RegisterWindow::UpdateIntegerRegister(wxTextCtrl* label, wxTextCtrl* value,
if (is_valid_string && buffer.tellp() > 1) if (is_valid_string && buffer.tellp() > 1)
{ {
label->SetLabelText(wxString::Format("\"%s\"", buffer.str().c_str())); label->ChangeValue(wxString::Format("\"%s\"", buffer.str().c_str()));
return; return;
} }
@ -206,7 +206,7 @@ void RegisterWindow::UpdateIntegerRegister(wxTextCtrl* label, wxTextCtrl* value,
if (is_valid_string && buffer.tellp() > 1) if (is_valid_string && buffer.tellp() > 1)
{ {
label->SetLabelText(wxString::Format(L"ws\"%s\"", wbuffer.str().c_str())); label->ChangeValue(wxString::Format(L"ws\"%s\"", wbuffer.str().c_str()));
return; return;
} }
} }
@ -215,11 +215,11 @@ void RegisterWindow::UpdateIntegerRegister(wxTextCtrl* label, wxTextCtrl* value,
RPLModule* code_module = RPLLoader_FindModuleByCodeAddr(registerValue); RPLModule* code_module = RPLLoader_FindModuleByCodeAddr(registerValue);
if (code_module) if (code_module)
{ {
label->SetLabelText(wxString::Format("<%s> + %x", code_module->moduleName2.c_str(), registerValue - code_module->regionMappingBase_text.GetMPTR())); label->ChangeValue(wxString::Format("<%s> + %x", code_module->moduleName2.c_str(), registerValue - code_module->regionMappingBase_text.GetMPTR()));
return; return;
} }
label->SetLabelText(wxEmptyString); label->ChangeValue(wxEmptyString);
} }
void RegisterWindow::OnUpdateView() void RegisterWindow::OnUpdateView()
@ -264,9 +264,9 @@ void RegisterWindow::OnUpdateView()
continue; continue;
if(m_show_double_values) if(m_show_double_values)
value->SetLabelText(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0)); value->ChangeValue(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0));
else else
value->SetLabelText(wxString::Format("%016llx", register_value)); value->ChangeValue(wxString::Format("%016llx", register_value));
} }
for (int i = 0; i < 32; ++i) for (int i = 0; i < 32; ++i)
@ -285,9 +285,9 @@ void RegisterWindow::OnUpdateView()
continue; continue;
if (m_show_double_values) if (m_show_double_values)
value->SetLabelText(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1)); value->ChangeValue(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1));
else else
value->SetLabelText(wxString::Format("%016llx", register_value)); value->ChangeValue(wxString::Format("%016llx", register_value));
} }
// update CRs // update CRs
@ -318,9 +318,9 @@ void RegisterWindow::OnUpdateView()
joinArray.emplace_back("SO"); joinArray.emplace_back("SO");
if (joinArray.empty()) if (joinArray.empty())
value->SetLabelText("-"); value->ChangeValue("-");
else else
value->SetLabelText(fmt::format("{}", fmt::join(joinArray, ", "))); value->ChangeValue(fmt::format("{}", fmt::join(joinArray, ", ")));
} }
memcpy(&m_prev_snapshot, &debuggerState.debugSession.ppcSnapshot, sizeof(m_prev_snapshot)); memcpy(&m_prev_snapshot, &debuggerState.debugSession.ppcSnapshot, sizeof(m_prev_snapshot));
@ -399,13 +399,13 @@ void RegisterWindow::OnFPViewModePress(wxCommandEvent& event)
if (m_show_double_values) if (m_show_double_values)
{ {
value0->SetLabelText(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0)); value0->ChangeValue(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0));
value1->SetLabelText(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1)); value1->ChangeValue(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1));
} }
else else
{ {
value0->SetLabelText(wxString::Format("%016llx", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0int)); value0->ChangeValue(wxString::Format("%016llx", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0int));
value1->SetLabelText(wxString::Format("%016llx", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1int)); value1->ChangeValue(wxString::Format("%016llx", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1int));
} }
} }
} }