diff --git a/rpcs3/rpcs3qt/debugger_frame.cpp b/rpcs3/rpcs3qt/debugger_frame.cpp index 8bd80b7a77..8a9e1330c8 100644 --- a/rpcs3/rpcs3qt/debugger_frame.cpp +++ b/rpcs3/rpcs3qt/debugger_frame.cpp @@ -420,11 +420,9 @@ void debugger_frame::UpdateUnitList() return; } + const int old_size = m_choice_units->count(); QVariant old_cpu = m_choice_units->currentData(); - m_choice_units->clear(); - m_choice_units->addItem(NoThreadString); - const auto on_select = [&](u32 id, cpu_thread& cpu) { QVariant var_cpu = QVariant::fromValue>( @@ -437,8 +435,17 @@ void debugger_frame::UpdateUnitList() { const QSignalBlocker blocker(m_choice_units); + m_choice_units->clear(); + m_choice_units->addItem(NoThreadString); + idm::select>(on_select); idm::select>(on_select); + + if (m_choice_units->count() > 1 && old_size <= 1) + { + // Select the first thread after "No Thread", usually the PPU main thread + m_choice_units->setCurrentIndex(1); + } } OnSelectUnit(); diff --git a/rpcs3/rpcs3qt/debugger_frame.h b/rpcs3/rpcs3qt/debugger_frame.h index 317ea23883..5f73d2e266 100644 --- a/rpcs3/rpcs3qt/debugger_frame.h +++ b/rpcs3/rpcs3qt/debugger_frame.h @@ -39,8 +39,8 @@ class debugger_frame : public custom_dock_widget QTimer* m_update; QSplitter* m_splitter; - u64 m_threads_created = 0; - u64 m_threads_deleted = 0; + u64 m_threads_created = -1; + u64 m_threads_deleted = -1; u32 m_last_pc = -1; std::vector m_last_query_state; u32 m_last_step_over_breakpoint = -1;