@@ -88,9 +88,6 @@ debugger_frame::debugger_frame(QWidget *parent) : QDockWidget(tr("Debugger"), pa
88
88
});
89
89
connect (m_choice_units, static_cast <void (QComboBox::*)(int )>(&QComboBox::activated), this , &debugger_frame::UpdateUI);
90
90
connect (m_choice_units, static_cast <void (QComboBox::*)(int )>(&QComboBox::currentIndexChanged), this , &debugger_frame::OnSelectUnit);
91
- connect (m_choice_units, static_cast <void (QComboBox::*)(int )>(&QComboBox::currentIndexChanged), m_list, [=](int index ) {
92
- m_list->m_noThreadSelected = m_choice_units->itemText (index ) == NoThread ? true : false ;
93
- });
94
91
connect (this , &QDockWidget::visibilityChanged, this , &debugger_frame::EnableUpdateTimer);
95
92
96
93
m_list->ShowAddr (CentrePc (m_list->m_pc ));
@@ -103,7 +100,6 @@ void debugger_frame::closeEvent(QCloseEvent *event)
103
100
emit DebugFrameClosed ();
104
101
}
105
102
106
- // static const int show_lines = 30;
107
103
#include < map>
108
104
109
105
std::map<u32, bool > g_breakpoints;
@@ -137,6 +133,8 @@ void debugger_frame::UpdateUI()
137
133
{
138
134
UpdateUnitList ();
139
135
136
+ if (m_noThreadSelected) return ;
137
+
140
138
const auto cpu = this ->cpu .lock ();
141
139
142
140
if (!cpu)
@@ -228,37 +226,43 @@ void debugger_frame::UpdateUnitList()
228
226
229
227
void debugger_frame::OnSelectUnit ()
230
228
{
231
- if (m_choice_units->count () < 1 || m_current_choice == m_choice_units->currentText () || m_choice_units-> currentText () == NoThread ) return ;
229
+ if (m_choice_units->count () < 1 || m_current_choice == m_choice_units->currentText ()) return ;
232
230
233
231
m_current_choice = m_choice_units->currentText ();
232
+ m_noThreadSelected = m_current_choice == NoThread;
233
+ m_list->m_noThreadSelected = m_noThreadSelected;
234
234
235
235
m_disasm.reset ();
236
+ cpu.reset ();
236
237
237
- const auto on_select = [&](u32, cpu_thread& cpu )
238
+ if (!m_noThreadSelected )
238
239
{
239
- cpu_thread* data = (cpu_thread *)m_choice_units->currentData ().value <void *>();
240
- return data == &cpu;
241
- };
240
+ const auto on_select = [&](u32, cpu_thread& cpu)
241
+ {
242
+ cpu_thread* data = (cpu_thread *)m_choice_units->currentData ().value <void *>();
243
+ return data == &cpu;
244
+ };
242
245
243
- if (auto ppu = idm::select <ppu_thread>(on_select))
244
- {
245
- m_disasm = std::make_unique<PPUDisAsm>(CPUDisAsm_InterpreterMode);
246
- cpu = ppu.ptr ;
247
- }
248
- else if (auto spu1 = idm::select <SPUThread>(on_select))
249
- {
250
- m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
251
- cpu = spu1.ptr ;
252
- }
253
- else if (auto rspu = idm::select <RawSPUThread>(on_select))
254
- {
255
- m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
256
- cpu = rspu.ptr ;
257
- }
258
- else if (auto arm = idm::select <ARMv7Thread>(on_select))
259
- {
260
- m_disasm = std::make_unique<ARMv7DisAsm>(CPUDisAsm_InterpreterMode);
261
- cpu = arm.ptr ;
246
+ if (auto ppu = idm::select <ppu_thread>(on_select))
247
+ {
248
+ m_disasm = std::make_unique<PPUDisAsm>(CPUDisAsm_InterpreterMode);
249
+ cpu = ppu.ptr ;
250
+ }
251
+ else if (auto spu1 = idm::select <SPUThread>(on_select))
252
+ {
253
+ m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
254
+ cpu = spu1.ptr ;
255
+ }
256
+ else if (auto rspu = idm::select <RawSPUThread>(on_select))
257
+ {
258
+ m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
259
+ cpu = rspu.ptr ;
260
+ }
261
+ else if (auto arm = idm::select <ARMv7Thread>(on_select))
262
+ {
263
+ m_disasm = std::make_unique<ARMv7DisAsm>(CPUDisAsm_InterpreterMode);
264
+ cpu = arm.ptr ;
265
+ }
262
266
}
263
267
264
268
DoUpdate ();
@@ -373,7 +377,7 @@ void debugger_frame::Show_Val()
373
377
374
378
void debugger_frame::Show_PC ()
375
379
{
376
- if ( const auto cpu = this -> cpu . lock ()) m_list->ShowAddr (CentrePc (GetPc ()));
380
+ m_list->ShowAddr (CentrePc (GetPc ()));
377
381
}
378
382
379
383
void debugger_frame::DoStep ()
0 commit comments