Skip to content

Commit

Permalink
Hide 128reg warnings and use rgb: instead of # in pal test (#16220)
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored Mar 16, 2020
1 parent c8b632b commit 3099a82
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libr/core/cmd_anal.c
Original file line number Diff line number Diff line change
Expand Up @@ -5474,7 +5474,7 @@ static void cmd_aespc(RCore *core, ut64 addr, ut64 until_addr, int off) {
r_reg_setv (core->dbg->reg, "PC", aop.addr + aop.size);
const char *e = R_STRBUF_SAFEGET (&aop.esil);
if (e && *e) {
eprintf (" 0x%08llx %d %s\n", aop.addr, ret, aop.mnemonic);
// eprintf (" 0x%08llx %d %s\n", aop.addr, ret, aop.mnemonic);
(void)r_anal_esil_parse (esil, e);
}
}
Expand Down Expand Up @@ -5689,7 +5689,7 @@ static void cmd_anal_esil(RCore *core, const char *input) {
*n2++ = 0;
}
ut64 off = r_num_math (core->num, n);
ut64 nth = n2?r_num_math (core->num, n2):1;
ut64 nth = n2? r_num_math (core->num, n2): 1;
cmd_aespc (core, core->offset, off, (int)nth);
} else {
eprintf ("Usage: aesB [until-addr] [nth-opcodes] @ [from-addr]\n");
Expand Down
8 changes: 6 additions & 2 deletions libr/reg/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,15 @@ R_API bool r_reg_is_readonly(RReg *reg, RRegItem *item) {
}

R_API ut64 r_reg_setv(RReg *reg, const char *name, ut64 val) {
return r_reg_set_value (reg, r_reg_get (reg, name, -1), val);
r_return_val_if_fail (reg && name, UT64_MAX);
RRegItem *ri = r_reg_get (reg, name, -1);
return ri? r_reg_set_value (reg, ri, val): UT64_MAX;
}

R_API ut64 r_reg_getv(RReg *reg, const char *name) {
return r_reg_get_value (reg, r_reg_get (reg, name, -1));
r_return_val_if_fail (reg && name, UT64_MAX);
RRegItem *ri = r_reg_get (reg, name, -1);
return ri? r_reg_get_value (reg, ri): UT64_MAX;
}

R_API RRegItem *r_reg_get(RReg *reg, const char *name, int type) {
Expand Down
7 changes: 7 additions & 0 deletions libr/reg/value.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ R_API ut64 r_reg_get_value_big(RReg *reg, RRegItem *item, utX *val) {
}

R_API ut64 r_reg_get_value(RReg *reg, RRegItem *item) {
r_return_val_if_fail (reg && item, 0);
if (!reg || !item || item->offset == -1) {
return 0LL;
}
Expand Down Expand Up @@ -123,6 +124,9 @@ R_API ut64 r_reg_get_value(RReg *reg, RRegItem *item) {
case 96: // long floating value
// FIXME: It is a precision loss, please implement me properly!
return (ut64)r_reg_get_longdouble (reg, item);
case 128:
// XXX 128 bit
return (ut64)r_reg_get_longdouble (reg, item);
default:
eprintf ("r_reg_get_value: Bit size %d not supported\n", item->size);
break;
Expand Down Expand Up @@ -197,6 +201,9 @@ R_API bool r_reg_set_value(RReg *reg, RRegItem *item, ut64 value) {
buf[0] = (buf[0] & mask) | 0;
}
return true;
case 128:
// XXX 128 bit
return false; // (ut64)r_reg_get_longdouble (reg, item);
default:
eprintf ("r_reg_set_value: Bit size %d not supported\n", item->size);
return false;
Expand Down
2 changes: 1 addition & 1 deletion test/new/db/cmd/cmd_pd
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ pd 1
e scr.color=3
ec linehl none
pd 1
ec linehl #002f00
ec linehl rgb:002f00
pd 1
ec wordhl rgb:800
ecHw eax
Expand Down

0 comments on commit 3099a82

Please # to comment.