Skip to content

Commit 950e956

Browse files
authored
Fix register window not updating in PPC debugger (#864)
1 parent f0ef8f3 commit 950e956

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/gui/debugger/RegisterWindow.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void RegisterWindow::UpdateIntegerRegister(wxTextCtrl* label, wxTextCtrl* value,
145145
else if (value->GetForegroundColour() != COLOR_BLACK)
146146
value->SetForegroundColour(COLOR_BLACK);
147147

148-
value->SetLabelText(wxString::Format("%08x", registerValue));
148+
value->ChangeValue(wxString::Format("%08x", registerValue));
149149

150150
//const auto label = dynamic_cast<wxTextCtrl*>(GetWindowChild(kRegisterLabelR0 + i));
151151
//wxASSERT(label);
@@ -177,7 +177,7 @@ void RegisterWindow::UpdateIntegerRegister(wxTextCtrl* label, wxTextCtrl* value,
177177

178178
if (is_valid_string && buffer.tellp() > 1)
179179
{
180-
label->SetLabelText(wxString::Format("\"%s\"", buffer.str().c_str()));
180+
label->ChangeValue(wxString::Format("\"%s\"", buffer.str().c_str()));
181181
return;
182182
}
183183

@@ -206,7 +206,7 @@ void RegisterWindow::UpdateIntegerRegister(wxTextCtrl* label, wxTextCtrl* value,
206206

207207
if (is_valid_string && buffer.tellp() > 1)
208208
{
209-
label->SetLabelText(wxString::Format(L"ws\"%s\"", wbuffer.str().c_str()));
209+
label->ChangeValue(wxString::Format(L"ws\"%s\"", wbuffer.str().c_str()));
210210
return;
211211
}
212212
}
@@ -215,11 +215,11 @@ void RegisterWindow::UpdateIntegerRegister(wxTextCtrl* label, wxTextCtrl* value,
215215
RPLModule* code_module = RPLLoader_FindModuleByCodeAddr(registerValue);
216216
if (code_module)
217217
{
218-
label->SetLabelText(wxString::Format("<%s> + %x", code_module->moduleName2.c_str(), registerValue - code_module->regionMappingBase_text.GetMPTR()));
218+
label->ChangeValue(wxString::Format("<%s> + %x", code_module->moduleName2.c_str(), registerValue - code_module->regionMappingBase_text.GetMPTR()));
219219
return;
220220
}
221221

222-
label->SetLabelText(wxEmptyString);
222+
label->ChangeValue(wxEmptyString);
223223
}
224224

225225
void RegisterWindow::OnUpdateView()
@@ -264,9 +264,9 @@ void RegisterWindow::OnUpdateView()
264264
continue;
265265

266266
if(m_show_double_values)
267-
value->SetLabelText(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0));
267+
value->ChangeValue(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0));
268268
else
269-
value->SetLabelText(wxString::Format("%016llx", register_value));
269+
value->ChangeValue(wxString::Format("%016llx", register_value));
270270
}
271271

272272
for (int i = 0; i < 32; ++i)
@@ -285,9 +285,9 @@ void RegisterWindow::OnUpdateView()
285285
continue;
286286

287287
if (m_show_double_values)
288-
value->SetLabelText(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1));
288+
value->ChangeValue(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1));
289289
else
290-
value->SetLabelText(wxString::Format("%016llx", register_value));
290+
value->ChangeValue(wxString::Format("%016llx", register_value));
291291
}
292292

293293
// update CRs
@@ -318,9 +318,9 @@ void RegisterWindow::OnUpdateView()
318318
joinArray.emplace_back("SO");
319319

320320
if (joinArray.empty())
321-
value->SetLabelText("-");
321+
value->ChangeValue("-");
322322
else
323-
value->SetLabelText(fmt::format("{}", fmt::join(joinArray, ", ")));
323+
value->ChangeValue(fmt::format("{}", fmt::join(joinArray, ", ")));
324324
}
325325

326326
memcpy(&m_prev_snapshot, &debuggerState.debugSession.ppcSnapshot, sizeof(m_prev_snapshot));
@@ -399,13 +399,13 @@ void RegisterWindow::OnFPViewModePress(wxCommandEvent& event)
399399

400400
if (m_show_double_values)
401401
{
402-
value0->SetLabelText(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0));
403-
value1->SetLabelText(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1));
402+
value0->ChangeValue(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0));
403+
value1->ChangeValue(wxString::Format("%lf", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1));
404404
}
405405
else
406406
{
407-
value0->SetLabelText(wxString::Format("%016llx", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0int));
408-
value1->SetLabelText(wxString::Format("%016llx", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1int));
407+
value0->ChangeValue(wxString::Format("%016llx", debuggerState.debugSession.ppcSnapshot.fpr[i].fp0int));
408+
value1->ChangeValue(wxString::Format("%016llx", debuggerState.debugSession.ppcSnapshot.fpr[i].fp1int));
409409
}
410410
}
411411
}

0 commit comments

Comments
 (0)