Qt: Added button for breaking into the GDB debugger

This commit is contained in:
Jeffrey Pfau 2016-01-15 16:52:28 -08:00
parent a38beac307
commit c83e4e7e85
5 changed files with 26 additions and 1 deletions

View File

@ -61,6 +61,7 @@ Misc:
- GBA RR: Add support for resets in movies - GBA RR: Add support for resets in movies
- GBA Input: Consolidate GBA_KEY_NONE and GBA_NO_MAPPING - GBA Input: Consolidate GBA_KEY_NONE and GBA_NO_MAPPING
- Debugger: Convert breakpoints and watchpoints from linked-lists to vectors - Debugger: Convert breakpoints and watchpoints from linked-lists to vectors
- Qt: Added button for breaking into the GDB debugger
0.3.2: (2015-12-16) 0.3.2: (2015-12-16)
Bugfixes: Bugfixes:

View File

@ -75,3 +75,12 @@ void GDBController::listen() {
} }
m_gameController->threadContinue(); m_gameController->threadContinue();
} }
void GDBController::breakInto() {
if (!isAttached()) {
return;
}
m_gameController->threadInterrupt();
ARMDebuggerEnter(&m_gdbStub.d, DEBUGGER_ENTER_MANUAL, 0);
m_gameController->threadContinue();
}

View File

@ -34,6 +34,7 @@ public slots:
void attach(); void attach();
void detach(); void detach();
void listen(); void listen();
void breakInto();
signals: signals:
void listening(); void listening();

View File

@ -11,6 +11,7 @@
#include <QLineEdit> #include <QLineEdit>
#include <QMessageBox> #include <QMessageBox>
#include <QPushButton> #include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout> #include <QVBoxLayout>
#include "GDBController.h" #include "GDBController.h"
@ -45,10 +46,20 @@ GDBWindow::GDBWindow(GDBController* controller, QWidget* parent)
connect(m_bindAddressEdit, SIGNAL(textChanged(const QString&)), this, SLOT(bindAddressChanged(const QString&))); connect(m_bindAddressEdit, SIGNAL(textChanged(const QString&)), this, SLOT(bindAddressChanged(const QString&)));
settingsGrid->addWidget(m_bindAddressEdit, 1, 1, Qt::AlignLeft); settingsGrid->addWidget(m_bindAddressEdit, 1, 1, Qt::AlignLeft);
QHBoxLayout* buttons = new QHBoxLayout;
m_startStopButton = new QPushButton; m_startStopButton = new QPushButton;
mainSegment->addWidget(m_startStopButton); buttons->addWidget(m_startStopButton);
m_breakButton = new QPushButton;
m_breakButton->setText(tr("Break"));
buttons->addWidget(m_breakButton);
mainSegment->addLayout(buttons);
connect(m_gdbController, SIGNAL(listening()), this, SLOT(started())); connect(m_gdbController, SIGNAL(listening()), this, SLOT(started()));
connect(m_gdbController, SIGNAL(listenFailed()), this, SLOT(failed())); connect(m_gdbController, SIGNAL(listenFailed()), this, SLOT(failed()));
connect(m_breakButton, SIGNAL(clicked()), controller, SLOT(breakInto()));
if (m_gdbController->isAttached()) { if (m_gdbController->isAttached()) {
started(); started();
@ -91,6 +102,7 @@ void GDBWindow::started() {
m_portEdit->setEnabled(false); m_portEdit->setEnabled(false);
m_bindAddressEdit->setEnabled(false); m_bindAddressEdit->setEnabled(false);
m_startStopButton->setText(tr("Stop")); m_startStopButton->setText(tr("Stop"));
m_breakButton->setEnabled(true);
disconnect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(listen())); disconnect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(listen()));
connect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(detach())); connect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(detach()));
connect(m_startStopButton, SIGNAL(clicked()), this, SLOT(stopped())); connect(m_startStopButton, SIGNAL(clicked()), this, SLOT(stopped()));
@ -100,6 +112,7 @@ void GDBWindow::stopped() {
m_portEdit->setEnabled(true); m_portEdit->setEnabled(true);
m_bindAddressEdit->setEnabled(true); m_bindAddressEdit->setEnabled(true);
m_startStopButton->setText(tr("Start")); m_startStopButton->setText(tr("Start"));
m_breakButton->setEnabled(false);
disconnect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(detach())); disconnect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(detach()));
disconnect(m_startStopButton, SIGNAL(clicked()), this, SLOT(stopped())); disconnect(m_startStopButton, SIGNAL(clicked()), this, SLOT(stopped()));
connect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(listen())); connect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(listen()));

View File

@ -36,6 +36,7 @@ private:
QLineEdit* m_portEdit; QLineEdit* m_portEdit;
QLineEdit* m_bindAddressEdit; QLineEdit* m_bindAddressEdit;
QPushButton* m_startStopButton; QPushButton* m_startStopButton;
QPushButton* m_breakButton;
}; };
} }