Implement tcc-* commmand to unload all calling conventions ##anal (#17688)

This commit is contained in:
pancake 2020-09-22 10:03:37 +02:00 committed by GitHub
parent b905e7a3b0
commit c9e98e4645
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 1 deletions

View File

@ -42,6 +42,7 @@ static const char *help_msg_tcc[] = {
"tcc", "", "List all calling convcentions",
"tcc", " r0 pascal(r0,r1,r2)", "Show signature for the 'pascal' calling convention",
"tcc", "-pascal", "Remove the pascal cc",
"tcc-*", "", "Unregister all the calling conventions",
"tcck", "", "List calling conventions in k=v",
"tccl", "", "List the cc signatures",
"tccj", "", "List them in JSON",
@ -198,7 +199,11 @@ static void __core_cmd_tcc(RCore *core, const char *input) {
r_core_cmd_help (core, help_msg_tcc);
break;
case '-':
r_anal_cc_del (core->anal, r_str_trim_head_ro (input + 1));
if (input[1] == '*') {
sdb_reset (core->anal->sdb_cc);
} else {
r_anal_cc_del (core->anal, r_str_trim_head_ro (input + 1));
}
break;
case 0:
r_core_cmd0 (core, "afcl");

View File

@ -1,3 +1,17 @@
NAME=tcc-star
FILE=bins/elf/ls
CMDS=<<EOF
tcc
tcc-*
tcc
EOF
EXPECT=<<EOF
amd64
ms
swift
EOF
RUN
NAME=tcc
FILE=bins/elf/ls
CMDS=tcc