Fix profiling RCore.cmdCall() via ?t"" ##shell

This commit is contained in:
pancake 2023-01-05 11:53:52 +01:00 committed by pancake
parent 3ead2117be
commit 71dfd4d833
2 changed files with 20 additions and 0 deletions

View File

@ -3580,6 +3580,12 @@ static int r_core_cmd_subst(RCore *core, char *cmd) {
if (r_str_startswith (cmd, "\"\"")) {
return r_core_cmd_call (core, cmd + 2);
}
if (r_str_startswith (cmd, "?t\"\"")) {
char *c = r_str_newf ("?t\"\"%s", cmd + 4);
int res = r_core_cmd_call (core, c);
free (c);
return res;
}
if (r_str_startswith (cmd, "GET /cmd/")) {
memmove (cmd, cmd + 9, strlen (cmd + 9) + 1);

View File

@ -604,6 +604,20 @@ static int cmd_help(void *data, const char *input) {
}
core->curtab ++;
break;
case '"':
{
struct r_prof_t prof;
r_prof_start (&prof);
if (input[1] == '"') {
r_core_cmd_call (core, input + 3);
} else {
r_core_cmd (core, input + 1, 0);
}
r_prof_end (&prof);
r_core_return_value (core, (ut64)(int)prof.result);
eprintf ("%lf\n", prof.result);
}
break;
case ' ':
{
struct r_prof_t prof;