Fix #1335 - Fix CC!

This commit is contained in:
pancake 2014-09-15 10:18:00 +02:00
parent 4c0f2cc884
commit 227fb0242f
3 changed files with 19 additions and 3 deletions

View File

@ -707,7 +707,7 @@ free (rf);
arg = strchr (str+1, '=');
if (arg) {
char *string;
char *regname;
const char *regname;
*arg = 0;
string = r_str_chop (strdup (str+1));
regname = r_reg_get_name (core->dbg->reg,
@ -728,7 +728,7 @@ free (rf);
return;
} else {
int role = r_reg_get_name_idx (str+1);
char *regname = r_reg_get_name (core->dbg->reg, role);
const char *regname = r_reg_get_name (core->dbg->reg, role);
if (!regname)
regname = str+1;
size = atoi (regname);

View File

@ -234,6 +234,22 @@ error:
static int cmd_meta_comment(RCore *core, const char *input) {
ut64 addr = core->offset;
switch (input[1]) {
case '!':
{
char *out, *comment = r_meta_get_string (
core->anal, R_META_TYPE_COMMENT, addr);
out = r_core_editor (core, comment);
if (out) {
//r_meta_add (core->anal->meta, R_META_TYPE_COMMENT, addr, 0, out);
r_core_cmdf (core, "CC-@0x%08"PFMT64x, addr);
//r_meta_del (core->anal->meta, input[0], addr, addr+1, NULL);
r_meta_set_string (core->anal,
R_META_TYPE_COMMENT, addr, out);
free (out);
}
free (comment);
}
break;
case '+':
case ' ':
{

View File

@ -570,7 +570,7 @@ R_API int r_core_visual_cmd(RCore *core, int ch) {
r_cons_set_raw (R_TRUE);
break;
case '!':
r_cons_2048();
r_cons_2048 ();
break;
case 'o':
visual_offset (core);