add No Thread option
This commit is contained in:
@@ -88,6 +88,9 @@ debugger_frame::debugger_frame(QWidget *parent) : QDockWidget(tr("Debugger"), pa
|
|||||||
});
|
});
|
||||||
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &debugger_frame::UpdateUI);
|
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &debugger_frame::UpdateUI);
|
||||||
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &debugger_frame::OnSelectUnit);
|
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &debugger_frame::OnSelectUnit);
|
||||||
|
connect(m_choice_units, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), m_list, [=](int index) {
|
||||||
|
m_list->m_noThreadSelected = m_choice_units->itemText(index) == NoThread ? true : false;
|
||||||
|
});
|
||||||
connect(this, &QDockWidget::visibilityChanged, this, &debugger_frame::EnableUpdateTimer);
|
connect(this, &QDockWidget::visibilityChanged, this, &debugger_frame::EnableUpdateTimer);
|
||||||
|
|
||||||
m_list->ShowAddr(CentrePc(m_list->m_pc));
|
m_list->ShowAddr(CentrePc(m_list->m_pc));
|
||||||
@@ -200,6 +203,7 @@ void debugger_frame::UpdateUnitList()
|
|||||||
QVariant old_cpu = m_choice_units->currentData();
|
QVariant old_cpu = m_choice_units->currentData();
|
||||||
|
|
||||||
m_choice_units->clear();
|
m_choice_units->clear();
|
||||||
|
m_choice_units->addItem(NoThread);
|
||||||
|
|
||||||
const auto on_select = [&](u32, cpu_thread& cpu)
|
const auto on_select = [&](u32, cpu_thread& cpu)
|
||||||
{
|
{
|
||||||
@@ -224,7 +228,7 @@ void debugger_frame::UpdateUnitList()
|
|||||||
|
|
||||||
void debugger_frame::OnSelectUnit()
|
void debugger_frame::OnSelectUnit()
|
||||||
{
|
{
|
||||||
if (m_choice_units->count() < 1 || m_current_choice == m_choice_units->currentText()) return;
|
if (m_choice_units->count() < 1 || m_current_choice == m_choice_units->currentText() || m_choice_units->currentText() == NoThread) return;
|
||||||
|
|
||||||
m_current_choice = m_choice_units->currentText();
|
m_current_choice = m_choice_units->currentText();
|
||||||
|
|
||||||
@@ -525,7 +529,7 @@ void debugger_list::keyPressEvent(QKeyEvent* event)
|
|||||||
|
|
||||||
void debugger_list::mouseDoubleClickEvent(QMouseEvent* event)
|
void debugger_list::mouseDoubleClickEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton && !Emu.IsStopped())
|
if (event->button() == Qt::LeftButton && !Emu.IsStopped() && !m_noThreadSelected)
|
||||||
{
|
{
|
||||||
long i = currentRow();
|
long i = currentRow();
|
||||||
if (i < 0) return;
|
if (i < 0) return;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ class debugger_frame : public QDockWidget
|
|||||||
QPushButton* m_btn_pause;
|
QPushButton* m_btn_pause;
|
||||||
QComboBox* m_choice_units;
|
QComboBox* m_choice_units;
|
||||||
QString m_current_choice;
|
QString m_current_choice;
|
||||||
|
bool m_noThreadSelected = true;
|
||||||
|
|
||||||
u64 m_threads_created = 0;
|
u64 m_threads_created = 0;
|
||||||
u64 m_threads_deleted = 0;
|
u64 m_threads_deleted = 0;
|
||||||
@@ -54,6 +55,8 @@ class debugger_frame : public QDockWidget
|
|||||||
|
|
||||||
QTimer* update;
|
QTimer* update;
|
||||||
|
|
||||||
|
const QString NoThread = "No Thread";
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::unique_ptr<CPUDisAsm> m_disasm;
|
std::unique_ptr<CPUDisAsm> m_disasm;
|
||||||
std::weak_ptr<cpu_thread> cpu;
|
std::weak_ptr<cpu_thread> cpu;
|
||||||
@@ -96,6 +99,7 @@ class debugger_list : public QListWidget
|
|||||||
public:
|
public:
|
||||||
u32 m_pc;
|
u32 m_pc;
|
||||||
u32 m_item_count;
|
u32 m_item_count;
|
||||||
|
bool m_noThreadSelected;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
debugger_list(debugger_frame* parent);
|
debugger_list(debugger_frame* parent);
|
||||||
|
|||||||
Reference in New Issue
Block a user