From 22bd9e9fb5690044554c93d98ab1fef46c67a434 Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 22 Feb 2018 12:45:54 +0100 Subject: [PATCH] Add scr.slow and fix uninitialized var issue --- libr/core/cconfig.c | 1 + libr/core/disasm.c | 2 +- libr/core/visual.c | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libr/core/cconfig.c b/libr/core/cconfig.c index 6acbd1a34b..8e5b5b09a3 100644 --- a/libr/core/cconfig.c +++ b/libr/core/cconfig.c @@ -2755,6 +2755,7 @@ R_API int r_core_config_init(RCore *core) { SETCB ("scr.flush", "false", &cb_scrflush, "Force flush to console in realtime (breaks scripting)"); /* TODO: rename to asm.color.ops ? */ SETPREF ("scr.zoneflags", "true", "Show zoneflags in visual mode before the title (see fz?)"); + SETPREF ("scr.slow", "true", "Do slow stuff on visual mode like RFlag.get_at(true)"); SETPREF ("scr.color.ops", "true", "Colorize numbers and registers in opcodes"); SETPREF ("scr.color.bytes", "true", "Colorize bytes that represent the opcodes of the instruction"); #if __WINDOWS__ && !__CYGWIN__ diff --git a/libr/core/disasm.c b/libr/core/disasm.c index 9cbccf9808..ba04bd4aa6 100644 --- a/libr/core/disasm.c +++ b/libr/core/disasm.c @@ -3878,7 +3878,7 @@ static void ds_print_esil_anal(RDisasmState *ds) { RListIter *iter; RListIter *nextele; const char *fcn_name = NULL; - char *key; + char *key = NULL; ut64 pcv = ds->analop.jump; if (pcv == UT64_MAX) { pcv = ds->analop.ptr; // call [reloc-addr] // windows style diff --git a/libr/core/visual.c b/libr/core/visual.c index 082810321c..c58c04d1c3 100644 --- a/libr/core/visual.c +++ b/libr/core/visual.c @@ -2618,6 +2618,7 @@ R_API int r_core_visual_cmd(RCore *core, const char *arg) { } R_API void r_core_visual_title(RCore *core, int color) { + bool showDelta = r_config_get_i (core->config, "scr.slow"); static ut64 oldpc = 0; const char *BEGIN = core->cons->pal.prompt; const char *filename; @@ -2693,12 +2694,12 @@ R_API void r_core_visual_title(RCore *core, int color) { core->flags->space_strict = true; core->anal->flb.set_fs (core->flags, "symbols"); if (core->flags->space_idx != -1) { - f = core->anal->flb.get_at (core->flags, addr, false); + f = core->anal->flb.get_at (core->flags, addr, showDelta); } core->flags->space_strict = oss; core->flags->space_idx = osi; if (!f) { - f = r_flag_get_at (core->flags, addr, false); + f = r_flag_get_at (core->flags, addr, showDelta); } #else RFlagItem *f = r_flag_get_at (core->flags, addr, false);