Skip to content

Commit f319ce1

Browse files
authored
Implement afv- * (#5969)
1 parent 2b163fa commit f319ce1

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

librz/core/cmd/cmd_analysis.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,6 +2401,10 @@ RZ_IPI RzCmdStatus rz_analysis_function_vars_del_handler(RzCore *core, int argc,
24012401
return RZ_CMD_STATUS_ERROR;
24022402
}
24032403
const char *varname = argv[1];
2404+
if (!strcmp(varname, "*")) {
2405+
rz_analysis_function_delete_all_vars(fcn);
2406+
return RZ_CMD_STATUS_OK;
2407+
}
24042408
RzAnalysisVar *var = rz_analysis_function_get_var_byname(fcn, varname);
24052409
if (!var) {
24062410
RZ_LOG_ERROR("Variable \"%s\" not found.\n", varname);

test/db/cmd/cmd_afv

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,24 @@ EXPECT=<<EOF
3939
-0x00000028 var_28h: int64_t
4040
EOF
4141
RUN
42+
43+
NAME=afv- *
44+
FILE=bins/elf/vars-complex-x86_64-bp
45+
CMDS=<<EOF
46+
aa
47+
s sym.varfunc
48+
pdf~:1..4
49+
echo
50+
afv- *
51+
pdf~:1..4
52+
EOF
53+
EXPECT=<<EOF
54+
/ sym.varfunc(int64_t arg1);
55+
| ; arg int64_t arg1 @ rdi
56+
| ; var int64_t var_2ch @ stack - 0x2c
57+
58+
/ sym.varfunc();
59+
| 0x0000115c push rbp
60+
| 0x0000115d mov rbp, rsp
61+
EOF
62+
RUN

0 commit comments

Comments
 (0)