From 2bfa3b7a3f2a4b56783f89319d72137ee4c2fe10 Mon Sep 17 00:00:00 2001 From: mandlebro Date: Fri, 15 Jun 2018 18:33:17 +0100 Subject: [PATCH] fix saving settings when debugging --- src/Cutter.cpp | 10 ++++++++-- src/Cutter.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Cutter.cpp b/src/Cutter.cpp index 344d7d06..2a0b9f16 100644 --- a/src/Cutter.cpp +++ b/src/Cutter.cpp @@ -759,10 +759,15 @@ void CutterCore::setRegister(QString regName, QString regValue) void CutterCore::startDebug() { - offsetPriorDebugging = getOffset(); + if (!currentlyDebugging) { + offsetPriorDebugging = getOffset(); + } cmd("ood"); emit registersChanged(); - emit changeDebugView(); + if (!currentlyDebugging) { + emit changeDebugView(); + currentlyDebugging = true; + } } void CutterCore::stopDebug() @@ -772,6 +777,7 @@ void CutterCore::stopDebug() cmd("dk 9; ds; e cfg.debug = false; oo"); seek(offsetPriorDebugging); emit changeDefinedView(); + currentlyDebugging = false; } void CutterCore::continueDebug() diff --git a/src/Cutter.h b/src/Cutter.h index 8704cc57..30e15ee5 100644 --- a/src/Cutter.h +++ b/src/Cutter.h @@ -600,6 +600,7 @@ private: RVA offsetPriorDebugging = RVA_INVALID; QList plugins; + bool currentlyDebugging = false; }; class ccClass : public CutterCore