Skip to content

Commit

Permalink
Fix debug step over and out.
Browse files Browse the repository at this point in the history
The old code didn't make sense: capturing by reference function local variable in a lambda which will be executed as async task, checking result of async task before the task was even started.
  • Loading branch information
karliss committed Jan 30, 2025
1 parent 8ef0590 commit cb6035a
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions src/core/Cutter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2422,17 +2422,13 @@ void CutterCore::stepOverDebug()
return;
}
} else {
bool ret;
asyncTask(
[&](RzCore *core) {
ret = rz_core_debug_step_over(core, 1);
[](RzCore *core) {
rz_core_debug_step_over(core, 1);
rz_core_dbg_follow_seek_register(core);
return nullptr;
},
debugTask);
if (!ret) {
return;
}
}

emit debugTaskStateChanged();
Expand All @@ -2453,17 +2449,13 @@ void CutterCore::stepOutDebug()
}

emit debugTaskStateChanged();
bool ret;
asyncTask(
[&](RzCore *core) {
ret = rz_core_debug_step_until_frame(core);
[](RzCore *core) {
rz_core_debug_step_until_frame(core);
rz_core_dbg_follow_seek_register(core);
return nullptr;
},
debugTask);
if (!ret) {
return;
}

connect(debugTask.data(), &RizinTask::finished, this, [this]() {
debugTask.clear();
Expand Down Expand Up @@ -2492,17 +2484,13 @@ void CutterCore::stepBackDebug()
return;
}
} else {
bool ret;
asyncTask(
[&](RzCore *core) {
ret = rz_core_debug_step_back(core, 1);
[](RzCore *core) {
rz_core_debug_step_back(core, 1);
rz_core_dbg_follow_seek_register(core);
return nullptr;
},
debugTask);
if (!ret) {
return;
}
}
emit debugTaskStateChanged();

Expand Down

0 comments on commit cb6035a

Please sign in to comment.