rizin/librz/debug/p/native
Anton Kochkov 689bafb7a4
Rewrite the RzNum parser and calculator on tree-sitter (#4326)
Replace the hand-written parser in calc.c with a tree-sitter grammar
(subprojects/rizin-math-parser) and a typed evaluator. The old parser
could only ever produce a ut64 and folded anything it failed to read to
0, which left callers unable to tell a failed expression from one that
evaluated to zero.

Expressions now evaluate to an RzNumValue, a tagged union over ut64,
double, RzBitVector, arbitrary-precision integer and arbitrary-precision
decimal, carrying an RzNumError rather than signalling failure as 0.
Literals keep the width they were written with (5u8, 0xffu128, any width
from 1 to 65536), results that outgrow 64 bits promote to a big number on
their own, and a parse error, division by zero or unresolved identifier
reaches the caller.

rz_num_math() is deprecated. rz_num_math_ut64() keeps its exact behaviour
for callers that want a ut64, and rz_num_math_value() exposes the typed
result. rz_core_math() adds the RzCore-backed form used by the % command,
with rz_core_math_ut64() deprecated alongside it. rz-ax routes through the
typed API, so it prints values at full precision, reports errors on stderr
and exits non-zero. rz_il_lift_num() converts an expression to an
RzILOpPure, so a numeric argument can be lifted instead of pre-evaluated.

Legacy input still works: trailing base suffixes (101b, 35o, 212t), the
trailing-'h' hex form and the k/m/g scale suffixes are all accepted and
warn once, pointing at the 0b/0o/0t prefixes. doc/math.md documents the
language and doc/math-il-lift.md the lift; the grammar, the evaluator,
rz-ax and the % command are covered by unit and db tests.
2026-07-24 02:57:27 +08:00
..
bsd Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
bt RzReg: Associate roles with RzRegItem instead of name strings (#6291) 2026-04-30 12:03:51 +02:00
linux Rewrite the RzNum parser and calculator on tree-sitter (#4326) 2026-07-24 02:57:27 +08:00
maps Remove dead code (#4705) 2024-11-08 18:46:13 +08:00
reg Add Alpha linux native debugger (#6447) 2026-06-09 12:27:19 +08:00
windows Convert %ll format specifiers to PFMT64 (#6267) 2026-04-22 05:57:04 +08:00
xnu Remove unused xnu_native_hwstep_enable implementations (dead code) (#6300) 2026-05-03 07:39:45 +08:00
android_arm.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
android_arm64.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
android_x86_64.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
apple_aarch64.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
apple_arm.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
apple_ppc.c apple_ppc.c: restore forgotten header (#6583) 2026-07-01 19:35:33 +08:00
apple_x86_64.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
arm.c Format according to clang-format-13 2021-11-25 15:44:28 +08:00
bt.c librz/debug: native debugger plugin for RISC-V (#5966) 2026-04-26 16:28:07 +08:00
darwin.c Format according to clang-format-13 2021-11-25 15:44:28 +08:00
dragonfly.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
drx.c Use clang-format 15 instead of 14 2023-01-25 22:02:26 +08:00
kfbsd.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
linux_alpha.c Add Alpha linux native debugger (#6447) 2026-06-09 12:27:19 +08:00
linux_arm.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
linux_arm64.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
linux_mips32.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
linux_mips64.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
linux_other.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
linux_ppc.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
linux_riscv32.c librz/debug: native debugger plugin for RISC-V (#5966) 2026-04-26 16:28:07 +08:00
linux_riscv64.c librz/debug: native debugger plugin for RISC-V (#5966) 2026-04-26 16:28:07 +08:00
linux_riscv_common.c librz/debug: native debugger plugin for RISC-V (#5966) 2026-04-26 16:28:07 +08:00
linux_x86_64.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
netbsd.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
openbsd.c Refactor debug native plugin archos-wise and other minor refactors (#5295) 2025-09-01 00:00:35 +08:00
procfs.c SPDX Copyright text for all files based on history 2021-03-05 19:39:15 +08:00
procfs.h SPDX Copyright text for all files based on history 2021-03-05 19:39:15 +08:00
unsupported.c Reduce verbose error messages from unsupported native debugger (#6337) 2026-05-11 23:48:18 +08:00
windows.c Separate the setters for binfile objects and current binfile in RzBin. (#5342) 2025-09-07 12:19:29 +00:00