Permalink
|
|
@@ -32,6 +32,10 @@ void DebuggerController::setController(std::shared_ptr<CoreController> controlle |
|
|
connect(m_gameController.get(), &CoreController::stopping, [this]() {
|
|
|
setController(nullptr);
|
|
|
});
|
|
|
+ if (m_autoattach) {
|
|
|
+ m_autoattach = false;
|
|
|
+ attach();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -43,18 +47,21 @@ void DebuggerController::attach() { |
|
|
attachInternal();
|
|
|
m_gameController->setDebugger(m_debugger);
|
|
|
mDebuggerEnter(m_debugger, DEBUGGER_ENTER_ATTACHED, 0);
|
|
|
+ } else {
|
|
|
+ m_autoattach = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void DebuggerController::detach() {
|
|
|
- QObject::disconnect(m_autoattach);
|
|
|
if (!isAttached()) {
|
|
|
return;
|
|
|
}
|
|
|
if (m_gameController) {
|
|
|
CoreController::Interrupter interrupter(m_gameController);
|
|
|
shutdownInternal();
|
|
|
m_gameController->setDebugger(nullptr);
|
|
|
+ } else {
|
|
|
+ m_autoattach = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -67,7 +74,7 @@ void DebuggerController::breakInto() { |
|
|
}
|
|
|
|
|
|
void DebuggerController::shutdown() {
|
|
|
- QObject::disconnect(m_autoattach);
|
|
|
+ m_autoattach = false;
|
|
|
if (!isAttached()) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -39,7 +39,7 @@ public slots: |
|
|
std::shared_ptr<CoreController> m_gameController;
|
|
|
|
|
|
private:
|
|
|
- QMetaObject::Connection m_autoattach;
|
|
|
+ bool m_autoattach = false;
|
|
|
};
|
|
|
|
|
|
}
|
|
|
@@ -34,7 +34,6 @@ void GDBController::setBindAddress(uint32_t bindAddress) { |
|
|
}
|
|
|
|
|
|
void GDBController::listen() {
|
|
|
- CoreController::Interrupter interrupter(m_gameController);
|
|
|
if (!isAttached()) {
|
|
|
attach();
|
|
|
}
|
|
|
|
|
|
@@ -175,6 +175,9 @@ void Window::argumentsPassed(mArguments* args) { |
|
|
if (args->debuggerType == DEBUGGER_GDB) {
|
|
|
if (!m_gdbController) {
|
|
|
m_gdbController = new GDBController(this);
|
|
|
+ if (m_controller) {
|
|
|
+ m_gdbController->setController(m_controller);
|
|
|
+ }
|
|
|
m_gdbController->listen();
|
|
|
}
|
|
|
}
|
|
|
|
0 comments on commit
88ef2e2