From a78613904e48bc741fb40e7ce2d6a3a6364b35b1 Mon Sep 17 00:00:00 2001 From: yossizap Date: Sat, 19 Dec 2020 21:32:51 +0000 Subject: [PATCH] Fix debug seek to PC (#2527) --- src/core/Cutter.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index 0860404c..68fa9368 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -1581,7 +1581,7 @@ RVA CutterCore::getProgramCounterValue() if (currentlyDebugging) { // Use cmd because cmdRaw would not work with inner command backticked // TODO: Risky command due to changes in API, search for something safer - RVA addr = cmd("dr?`drn PC`").toULongLong(&ok, 16); + RVA addr = cmd("dr `drn PC`").toULongLong(&ok, 16); if (ok) { return addr; } @@ -1746,9 +1746,7 @@ void CutterCore::attachRemote(const QString &uri) connected = true; } } - // Use cmd because cmdRaw would not with inner command backticked - QString programCounterValue = cmd("dr?`drn PC`").trimmed(); - seekAndShow(programCounterValue); + seekAndShow(getProgramCounterValue()); if (!connected) { emit attachedRemote(false); emit debugTaskStateChanged(); @@ -1868,9 +1866,7 @@ void CutterCore::stopDebug() void CutterCore::syncAndSeekProgramCounter() { - // Use cmd because cmdRaw would not work with inner command backticked - QString programCounterValue = cmd("dr?`drn PC`").trimmed(); - seekAndShow(programCounterValue); + seekAndShow(getProgramCounterValue()); emit registersChanged(); }