rizin
rizin copied to clipboard
Unify assignment command code
There are multiple commands that handle assignments like e asm.arch=6502
. Right now, they all use their own logic and syntax to parse this from argc/argv, but it will be better to have only one behavior and reuse it everywhere to be consistent.
Affected commands:
-
e
-
ar
/dr
-
aezv
-
$
What do you have in mind?
In e
i'm just doing a split on =
.
Doesn't really matter what the syntax exactly is, but the current state is:
-
e
supportsk=v
but explicitly notk = v
in favor of multiple assignments in one call -
ar
/dr
support bothk=v
andk = v
, but no multiple assignments -
aezv
does not handle=
at all and only supportsaezv k v
I would be ok with using either the e
one or ar
/dr
one everywhere.
I think $
is a special case (no multiple assignments), since whitespace by itself can't be used to separate or delimit between multiple assignments there.
I've been looking at this, but I cannot seem to find the rz_analysis_regs_handler
and the rz_debug_regs_handler
definitions for ar
and dr
respectively, although they are both declared in rzlib/core/cmd_descs/cmd_descs.h
. It would be appreciated if someone could point me to the right place, as I seem to be missing something related to the project structure here.
edit: found librz/core/cmd/cmd_regs_meta.inc
, working on PR