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 065da3c commit 2da32e5
Showing 1 changed file with 26 additions and 40 deletions.
66 changes: 26 additions & 40 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 Expand Up @@ -4319,30 +4307,28 @@ QString CutterCore::getVersionInformation()
{
const char *name;
const char *(*callback)();
} vcs[] = {
{ "rz_arch", &rz_arch_version },
{ "rz_lib", &rz_lib_version },
{ "rz_egg", &rz_egg_version },
{ "rz_bin", &rz_bin_version },
{ "rz_cons", &rz_cons_version },
{ "rz_flag", &rz_flag_version },
{ "rz_core", &rz_core_version },
{ "rz_crypto", &rz_crypto_version },
{ "rz_bp", &rz_bp_version },
{ "rz_debug", &rz_debug_version },
{ "rz_hash", &rz_hash_version },
{ "rz_io", &rz_io_version },
} vcs[] = { { "rz_arch", &rz_arch_version },
{ "rz_lib", &rz_lib_version },
{ "rz_egg", &rz_egg_version },
{ "rz_bin", &rz_bin_version },
{ "rz_cons", &rz_cons_version },
{ "rz_flag", &rz_flag_version },
{ "rz_core", &rz_core_version },
{ "rz_crypto", &rz_crypto_version },
{ "rz_bp", &rz_bp_version },
{ "rz_debug", &rz_debug_version },
{ "rz_hash", &rz_hash_version },
{ "rz_io", &rz_io_version },
#if !USE_LIB_MAGIC
{ "rz_magic", &rz_magic_version },
{ "rz_magic", &rz_magic_version },
#endif
{ "rz_reg", &rz_reg_version },
{ "rz_sign", &rz_sign_version },
{ "rz_search", &rz_search_version },
{ "rz_syscall", &rz_syscall_version },
{ "rz_util", &rz_util_version },
/* ... */
{ NULL, NULL }
};
{ "rz_reg", &rz_reg_version },
{ "rz_sign", &rz_sign_version },
{ "rz_search", &rz_search_version },
{ "rz_syscall", &rz_syscall_version },
{ "rz_util", &rz_util_version },
/* ... */
{ NULL, NULL } };
versionInfo.append(getRizinVersionReadable());
versionInfo.append("\n");
for (i = 0; vcs[i].name; i++) {
Expand Down

0 comments on commit 2da32e5

Please sign in to comment.