all repos — mgba @ c83e4e7e851fcd268296c01eb09f21209486c69a

mGBA Game Boy Advance Emulator

Qt: Added button for breaking into the GDB debugger
Jeffrey Pfau jeffrey@endrift.com
Fri, 15 Jan 2016 16:52:28 -0800
commit

c83e4e7e851fcd268296c01eb09f21209486c69a

parent

a38beac307b7b42dbc5ad5806a92b91396bea555

M CHANGESCHANGES

@@ -61,6 +61,7 @@ - GBA RR: Add preliminary SRAM support for VBM loading

- GBA RR: Add support for resets in movies - GBA Input: Consolidate GBA_KEY_NONE and GBA_NO_MAPPING - 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) Bugfixes:
M src/platform/qt/GDBController.cppsrc/platform/qt/GDBController.cpp

@@ -75,3 +75,12 @@ emit listenFailed();

} m_gameController->threadContinue(); } + +void GDBController::breakInto() { + if (!isAttached()) { + return; + } + m_gameController->threadInterrupt(); + ARMDebuggerEnter(&m_gdbStub.d, DEBUGGER_ENTER_MANUAL, 0); + m_gameController->threadContinue(); +}
M src/platform/qt/GDBController.hsrc/platform/qt/GDBController.h

@@ -34,6 +34,7 @@ void setBindAddress(uint32_t bindAddress);

void attach(); void detach(); void listen(); + void breakInto(); signals: void listening();
M src/platform/qt/GDBWindow.cppsrc/platform/qt/GDBWindow.cpp

@@ -11,6 +11,7 @@ #include <QLabel>

#include <QLineEdit> #include <QMessageBox> #include <QPushButton> +#include <QHBoxLayout> #include <QVBoxLayout> #include "GDBController.h"

@@ -45,10 +46,20 @@ m_bindAddressEdit->setMaxLength(15);

connect(m_bindAddressEdit, SIGNAL(textChanged(const QString&)), this, SLOT(bindAddressChanged(const QString&))); settingsGrid->addWidget(m_bindAddressEdit, 1, 1, Qt::AlignLeft); + QHBoxLayout* buttons = new QHBoxLayout; + 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(listenFailed()), this, SLOT(failed())); + connect(m_breakButton, SIGNAL(clicked()), controller, SLOT(breakInto())); if (m_gdbController->isAttached()) { started();

@@ -91,6 +102,7 @@ void GDBWindow::started() {

m_portEdit->setEnabled(false); m_bindAddressEdit->setEnabled(false); m_startStopButton->setText(tr("Stop")); + m_breakButton->setEnabled(true); disconnect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(listen())); connect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(detach())); connect(m_startStopButton, SIGNAL(clicked()), this, SLOT(stopped()));

@@ -100,6 +112,7 @@ void GDBWindow::stopped() {

m_portEdit->setEnabled(true); m_bindAddressEdit->setEnabled(true); m_startStopButton->setText(tr("Start")); + m_breakButton->setEnabled(false); disconnect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(detach())); disconnect(m_startStopButton, SIGNAL(clicked()), this, SLOT(stopped())); connect(m_startStopButton, SIGNAL(clicked()), m_gdbController, SLOT(listen()));
M src/platform/qt/GDBWindow.hsrc/platform/qt/GDBWindow.h

@@ -36,6 +36,7 @@

QLineEdit* m_portEdit; QLineEdit* m_bindAddressEdit; QPushButton* m_startStopButton; + QPushButton* m_breakButton; }; }