diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index 30f542734..4315a20a2 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -3123,9 +3123,7 @@ void CutterCore::handleREvent(int type, void *data) } case R_EVENT_DEBUG_PROCESS_FINISHED: { auto ev = reinterpret_cast(data); - QMessageBox msgBox; - msgBox.setText(tr("Debugged process exited (") + QString::number(ev->pid) + ")"); - msgBox.exec(); + emit debugProcessFinished(ev->pid); break; } default: diff --git a/src/core/Cutter.h b/src/core/Cutter.h index 8763ccae8..5ada7df42 100644 --- a/src/core/Cutter.h +++ b/src/core/Cutter.h @@ -531,6 +531,11 @@ class CutterCore: public QObject void classRenamed(const QString &oldName, const QString &newName); void classAttrsChanged(const QString &cls); + /** + * @brief end of current debug event received + */ + void debugProcessFinished(int pid); + void attachedRemote(bool successfully); void projectSaved(bool successfully, const QString &name); diff --git a/src/widgets/DebugActions.cpp b/src/widgets/DebugActions.cpp index a282e2be5..41a4562cf 100644 --- a/src/widgets/DebugActions.cpp +++ b/src/widgets/DebugActions.cpp @@ -110,6 +110,12 @@ DebugActions::DebugActions(QToolBar *toolBar, MainWindow *main) : actionContinueUntilCall, actionContinueUntilSyscall}; toggleConnectionActions = {actionAttach, actionStartRemote}; + connect(Core(), &CutterCore::debugProcessFinished, this, [ = ](int pid) { + QMessageBox msgBox; + msgBox.setText(tr("Debugged process exited (") + QString::number(pid) + ")"); + msgBox.exec(); + }); + connect(Core(), &CutterCore::debugTaskStateChanged, this, [ = ]() { bool disableToolbar = Core()->isDebugTaskInProgress(); if (Core()->currentlyDebugging) {