Qt: Attach debugger when attaching scripting controller (fixes #3046)

This commit is contained in:
Vicki Pfau 2023-10-15 19:42:50 -07:00
parent dca568a0be
commit 6ecc182d7c
2 changed files with 9 additions and 2 deletions

View File

@ -77,7 +77,7 @@ void ScriptingController::setController(std::shared_ptr<CoreController> controll
CoreController::Interrupter interrupter(m_controller);
m_controller->thread()->scriptContext = &m_scriptContext;
if (m_controller->hasStarted()) {
mScriptContextAttachCore(&m_scriptContext, m_controller->thread()->core);
attach();
}
updateVideoScale();
connect(m_controller.get(), &CoreController::stopping, this, &ScriptingController::clearController);
@ -154,7 +154,7 @@ void ScriptingController::reset() {
m_activeEngine = nullptr;
init();
if (m_controller && m_controller->hasStarted()) {
mScriptContextAttachCore(&m_scriptContext, m_controller->thread()->core);
attach();
}
}
@ -298,6 +298,12 @@ void ScriptingController::updateGamepad() {
}
}
void ScriptingController::attach() {
CoreController::Interrupter interrupter(m_controller);
mScriptContextAttachCore(&m_scriptContext, m_controller->thread()->core);
m_controller->attachDebugger(false);
}
void ScriptingController::attachGamepad() {
mScriptGamepad* pad = mScriptContextGamepadLookup(&m_scriptContext, 0);
if (pad == &m_gamepad) {

View File

@ -67,6 +67,7 @@ protected:
private slots:
void updateGamepad();
void attach();
private:
void init();