librz/config: merge graph.offset into asm.offset (#5596)

* Remove graph.offset evar
* db/cmd/cmd_visual: Set `e asm.offset=false`
* Use `rz_config_set_b` when setting `asm.offset`
This commit is contained in:
Premade 2025-12-10 11:52:21 +05:00 committed by GitHub
parent 61f06f07ee
commit 0c60f8689c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 8 deletions

View file

@ -42,7 +42,6 @@ Execute a command on the visual prompt with cmd.vprompt
Reduce the delta where flag resolving by address is used with cfg.delta
Disable these messages with 'e cfg.fortunes=false' in your ~/.rizinrc
Change your fortune types with 'e cfg.fortunes.file=fun,tips' in your ~/.rizinrc
Show offsets in graphs with 'e graph.offset=true'
Execute a command every time a breakpoint is hit with 'e cmd.bp=!my-program'
Disassemble in intel syntax with 'e asm.syntax=intel'.
Change the UID of the debugged process with child.uid (requires root)

View file

@ -2131,7 +2131,7 @@ static char *get_body(RzCore *core, ut64 addr, int size, int opts) {
const bool o_cmtright = rz_config_get_i(core->config, "graph.cmtright");
const bool o_bytes = rz_config_get_i(core->config, "graph.bytes");
const bool o_flags_in_bytes = rz_config_get_i(core->config, "asm.flags.inbytes");
const bool o_graph_offset = rz_config_get_i(core->config, "graph.offset");
const bool o_asm_offset = rz_config_get_i(core->config, "asm.offset");
int o_cursor = core->print->cur_enabled;
if (opts & BODY_COMMENTS) {
rz_core_visual_toggle_decompiler_disasm(core, true, false);
@ -2159,11 +2159,8 @@ static char *get_body(RzCore *core, ut64 addr, int size, int opts) {
rz_config_set_i(core->config, "asm.bb.middle", false);
core->print->cur_enabled = false;
if (opts & BODY_OFFSETS || opts & BODY_SUMMARY || o_graph_offset) {
rz_config_set_i(core->config, "asm.offset", true);
} else {
rz_config_set_i(core->config, "asm.offset", false);
}
rz_config_set_b(core->config, "asm.offset",
(opts & BODY_OFFSETS) || (opts & BODY_SUMMARY) || o_asm_offset);
bool html = rz_config_get_i(core->config, "scr.html");
rz_config_set_i(core->config, "scr.html", 0);

View file

@ -3687,7 +3687,6 @@ RZ_API int rz_core_config_init(RzCore *core) {
SETI("graph.layout", 0, "Graph layout (0=vertical, 1=horizontal)");
SETI("graph.linemode", 1, "Graph edges (0=diagonal, 1=square)");
SETPREF("graph.font", "Courier", "Font for dot graphs");
SETBPREF("graph.offset", "false", "Show offsets in graphs");
SETBPREF("graph.bytes", "false", "Show opcode bytes in graphs");
SETI("graph.from", UT64_MAX, "Lower bound address when drawing global graphs");
SETI("graph.to", UT64_MAX, "Upper bound address when drawing global graphs");

View file

@ -204,6 +204,7 @@ CMDS=<<EOF
e scr.interactive=true
e scr.columns=80
e scr.rows=12
e asm.offset=false
aF
< qq; VV
echo