Fix #18316 - ?0 and ?1 were a bad idea, move to ?t (#18321)

This commit is contained in:
pancake 2021-02-01 15:05:19 +01:00 committed by GitHub
parent 35731c185c
commit d2e62ed672
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 32 additions and 20 deletions

View File

@ -469,15 +469,36 @@ static int cmd_help(void *data, const char *input) {
RList *tmp;
switch (input[0]) {
case '0': // "?0"
core->curtab = 0;
break;
case '1': // "?1"
if (core->curtab < 0) {
case 't': { // "?t"
switch (input[1]) {
case '0':
core->curtab = 0;
break;
case '1':
if (core->curtab < 0) {
core->curtab = 0;
}
core->curtab ++;
break;
case ' ':
{
struct r_prof_t prof;
r_prof_start (&prof);
r_core_cmd (core, input + 1, 0);
r_prof_end (&prof);
core->num->value = (ut64)(int)prof.result;
eprintf ("%lf\n", prof.result);
break;
}
default:
eprintf ("Usage: ?t[0,1] [cmd]\n");
eprintf ("?t pd 32 # show time needed to run 'pd 32'\n");
eprintf ("?t0 # select first visual tab\n");
eprintf ("?t1 # select next visual tab\n");
break;
}
core->curtab ++;
break;
}
case 'r': // "?r"
{ // TODO : Add support for 64bit random numbers
ut64 b = 0;
@ -1192,15 +1213,6 @@ static int cmd_help(void *data, const char *input) {
free (rstr);
break;
}
case 't': { // "?t"
struct r_prof_t prof;
r_prof_start (&prof);
r_core_cmd (core, input + 1, 0);
r_prof_end (&prof);
core->num->value = (ut64)(int)prof.result;
eprintf ("%lf\n", prof.result);
break;
}
case '?': // "??"
if (input[1] == '?') {
if (input[2] == '?') { // "???"

View File

@ -4128,8 +4128,8 @@ static void visual_refresh(RCore *core) {
break;
}
snprintf (debugstr, sizeof (debugstr),
"?0;%s %d @ %"PFMT64d";cl;"
"?1;%s %d @ %"PFMT64d";",
"?t0;%s %d @ %"PFMT64d";cl;"
"?t1;%s %d @ %"PFMT64d";",
pxw, size, splitPtr,
pxw, size, core->offset);
core->print->screen_bounds = 1LL;
@ -4313,7 +4313,7 @@ dodo:
if (cmdvhex && *cmdvhex) {
snprintf (debugstr, sizeof (debugstr),
"?0;f tmp;ssr %s;%s;?1;%s;?1;"
"?t0;f tmp;ssr %s;%s;?1;%s;?1;"
"ss tmp;f-tmp;pd $r", reg, cmdvhex,
ref? "drr": "dr=");
debugstr[sizeof (debugstr) - 1] = 0;
@ -4323,8 +4323,8 @@ dodo:
const int absdelta = R_ABS (delta);
snprintf (debugstr, sizeof (debugstr),
"diq;?0;f tmp;ssr %s;%s %d@$$%c%d;"
"?1;%s;"
"?1;ss tmp;f-tmp;afal;pd $r",
"?t1;%s;"
"?t1;ss tmp;f-tmp;afal;pd $r",
reg, pxa? "pxa": pxw, size, sign, absdelta,
ref? "drr": "dr=");
}