rizin/test/db/cmd/cmd_eval
Anton Kochkov 3c59df7e98
Refactor RzTypes to use structs instead of SDB + New Tree-Sitter based C Parser (#1047)
- Removed oldshell version of `t` (types) commands
- Removed `tk` command because types storage switched to the hashtable
- Added `tfc` command to show the calling convention of the function or set it
- Added `tsl` (RZ_OUTPUT_MODE_LONG) to show structure members' sizes and offsets
- Added `tul` (RZ_OUTPUT_MODE_LONG) to show union members' sizes
- Switched the types storage to the hashtable instead of SDB
- Added load and export from/to SDB for standard type libraries and serialization for Projects
- Changed all `char *type` occurences to the proper `RzType`
- Added `RzCallable` type for the function/class method types
- Changed all function types API to use the `RzCallable` API
- Switched the function types (`RzCallable`) storage to the hashtable instead of SDB
- Added a connection between `RzAnalysisFunction` and `RzCallable` - `rz_analysis_function_derive_type()` API function to derive new `RzCallable` type from the `RzAnalysisFunction` even if it doesn't exist in the RzTypeDB.
- Moved type links to the RzAnalysis where they belong
- Removed TCC and MPC-based parsers
- Added Tree-Sitter-based parser for C grammar (see `librz/type/parser/*`)
- Reworked type databases in `librz/analysis/d/` to be consistent with C standard, libc, platform-specific definitions
- Switched the type links from `char *` to `RzType`
- Switched the type links from SDB to the hashtable
- Added concept of the "type paths", e.g. `a.b[20].c` where `b` is a member of `a` (`a` is either structure or a union) and `c` is a member of `b`, and `b` is an array where we take 20-th element.
- Added concept of the typeclasses (a bit similar to Haskell) for numerical types: `None` (the most generic one), `Num` (includes `Integral` and `Floating`), `Integral` (includes `Signed Integral` and `Unsigned Integral`), `Floating`.
- Added concept of type equality (`rz_types_equal(a, b)` API function)
- Added Doxygen documentation to every API function in the `librz/type/*`.
- Updated the project format from **V2** to **V3**, added migration.
2021-07-20 01:46:45 +08:00

108 lines
1.3 KiB
Text

NAME=et
FILE==
CMDS=<<EOF
et asm.slow
et asm.bits
et asm.arch
et search.from
EOF
EXPECT=<<EOF
bool
int
str
addr
EOF
RUN
NAME=e-dot
FILE==
CMDS=e zoom.
EXPECT=<<EOF
zoom.byte = h
zoom.from = 0
zoom.in = io.map
zoom.maxsz = 512
zoom.to = 0
EOF
RUN
NAME=e analysis.gp(mips)
FILE=bins/elf/analysis/mips64r2-cc1
CMDS=e analysis.gp
EXPECT=<<EOF
0x1213a5940
EOF
RUN
NAME=e asm.os
FILE=bins/elf/analysis/hello-linux-x86_64
CMDS=e asm.os=?
EXPECT=<<EOF
ios
dos
darwin
linux
freebsd
openbsd
netbsd
windows
s110
none
EOF
RUN
NAME=e asm.cpu
FILE=bins/elf/analysis/hello-linux-x86_64
CMDS=<<EOF
e asm.arch=mips
e asm.cpu=?
EOF
EXPECT=<<EOF
mips32/64
micro
r6
v3
v2
EOF
RUN
NAME=e asm.syntax
FILE==
CMDS=<<EOF
wx eb0e
e asm.arch=x86
e asm.syntax=masm
pi 1
EOF
EXPECT=<<EOF
jmp 10h
EOF
RUN
NAME=multiple assignments
FILE==
CMDS=<<EOF
"e scr.highlight= scr.highlight.grep =scr.rainbow =true "
e scr.highlight
e scr.highlight.grep
e scr.rainbow
EOF
EXPECT=<<EOF
scr.highlight.grep =scr.rainbow =true
false
false
EOF
RUN
NAME=multiple assignments with quotes
FILE==
CMDS=<<EOF
e cmd.prompt='scr.highlight = "e cmd.prompt = "e scr.highlight = cmd.prompt ="e scr.rainbow = true """'
e cmd.prompt
e scr.highlight
EOF
EXPECT=<<EOF
scr.highlight = "e cmd.prompt = "e scr.highlight = cmd.prompt ="e scr.rainbow = true """
EOF
RUN