Adds /*<type>*/ comments and a linter check from rz-bindgen to enforce
their existence and consistency
Also includes the following fixes made when adding the annotations:
* removed unused intern_table arguments in pyc_dis.c, pyc_dis.h, asm_pyc.c
* removed unused classes argument from place_nodes in agraph.c
* removed unused recurse and recurse_bb functions in canalysis.c
* removed unused vars field from RzPrint struct
* removed unused RzAnalysisType* structs from rz_analysis.h
* removed unused list field from RzEgg struct
* fixed bug in bp_plugin.c where duplication-checking logic iterates over the wrong list
* removed unused q_regs field from RzDebug struct
* removed unused backtrace field from RzDebugPlugin struct
* removed unused classes_list field from RzBinNXOObj struct
* removed unused methods_list and classes_list fields from RzBinZimgObj struct
* RzBin/ELF: avoid the creation of useless flags at 0
Use UT64_MAX as an error value for addresses like symbols, imports,
sections, etc., and do not create flags for those because they are not
meaningful. This is useful for imports that do not have an address in
the virtual/file space and for non-alloc sections (e.g. .comment).
Due to some commands/tests still using the legacy "..." commands, we
can't fully remove oldshell code yet, but with this patch we just hide
it from the end users. Rzshell is now the default and only shell and
rzshell autocompletion is the default and only autocompletion engine.
* Create `rz_windows.h`
* Move `RzThread` structure definitions to internal header
* Create and use `rz_th_get_user()` API to avoid exposing `RzThread` layout in external header
* Make `rz_th_self()` an IPI
* Use `_wmkdir()` in `rz_sys_mkdir()` on Windows
* Remove unused `winkd_break_read` function
* Remove `RzIORap` definition from `rz_io.h`
* Remove include of `Windows.h` from `rz_types.h`
* Use `rz_windows.h` when necessary
* Remove `RzCoreRtrHost` definition from `rz_core.h`
* Remove `rz_socket.h` include from `rz_core.h`
So far all the help sections were statically generated from the YAML
files, however sometimes you may want to list things in the help
messages that depend on what is loaded in Rizin (e.g. plugins, etc.).
This patch adds support for a details_cb that provides a dynamically
created RzCmdDescDetail array.
* Changed behavior of `f` to only add flag if there is none
* Changed behavior of `f+` to add flag in any case
* Moved listing subcommands from `f` to `fl`
* Moved listing subcommands from `f.` to `f.l`
* Added subcommand `f.l*` to list all local flags in all functions
* Listing flags at the current offset became `fl.`
* Moved `f=` to `fl=`
* Old `fl` (flag length) now became `fL`
* Removed original `fe` commands
* Old `f?` (check if flag exists) now became `fe`
* Removed `fV` commands
* Removed `fn` commands in favor of `fl` and `asm.flags.real=true`
* Removed `fS` commands (`fSo` and `fSn`)
* `fo` became `fortune` and moved from "flags" to "shell" category
* Removed oldshell handlers of the `z` commands
* Added rz_core_is_debug() to check for debug mode instead of hard-coding "cfg.debug"
* rz_core_reg_default() uses the above to get the currently relevant RzReg
* rz_core_debug_regs2flags() -> rz_core_reg_update_flags() uses the above
to update the flags.
* C352467: Free the heap allocated string after appending to `RzStrBuf`
* Remove unused variable `nofail`
* C352453: Free `fieldstr` after appending to `format`
* C350836: Free `name` before returning inside the loop
* C349252, C349231: Free `ta` when breaking halfway through the loop
* C349248: Free `pj` before breaking from switch statement
* C366622: Check result of `strtok` (`fcnname_aux`) for `NULL`
* Free `RzList` before returning from macro `SYNC_READ`
* Fixes Coverity issues 366625, 366624, 366623, 366621 and probably
a few others as well
* C366620: Check `arg` for `NULL` before dereferncing in `strchr`
* C366618: Cleanup `parse_lis` and use `rz_str_*` API instead of C `str` API
* Fix `SYNC_` macros in `cmd_regs.c` to no return prematurely
* C365952: Check `x` for `NULL` before dereferencing
* C365936: Use a wider integer type for the bitshift
* C365808: Fix double free of `real_type`
* C365805: Remove redundant `NULL` check for `path`
* Show group-level details of commands
Details can be defined at either a group command or its subcommand of
the same name. If define on group-level it will also be shown in the
group help without needing ??.
* Fix > $ redirection for errored command and leak
* Rewrite ar and dr commands with newshell
Breaking changes:
ar* => arf, ar- => arf-, ar. => ar*
ar, => art, ar? => arq
ar0 => ara0, arb => arab, ars => araS
arC => arpC
arn => arR
art => arT
arf => arF
Removed: drm, aer
* Add `rz_goto_if_fail` macro
* Useful when one needs cleaning up before returning
* Coverity 364174: Free `alloc` before returning
* Coverity 364179: Return NULL before allocating ret to avoid memleak
* Coverity 364177: Return NULL before allocating ret to avoid memleak
* Coverity 364167: Free `ret` before returning prematurely
* Coverity 364165: Return NULL before allocating ret to avoid memleak
* Coverity 356612: Free list `dbg_maps_addrs` in the `err` goto
* Coverity 354023: Free `type` when cleaning up
* Cov. 352571, 352465: Goto `urnexit` so that `real_*` variables are freed
* C352564: Allocat `fmt` in every case, and free it before returning
* C352449, C352557, C352449: Don't leak `real_*` variables
* Added rz_analysis_get_address_bits() instead of arch-specific hacks in core
* flags are only set for address-sized registers
* dr/ar show registers of any size by default, but hiding registers that are entirely
covered by others
* Create new category for shell commands in new shell
* Port `env` and `exit`
* Port `ls`, `rm`, `sleep`, `uniq`, `uname` to new shell
* Rename `cname`s for shell commands
* Port `cp`, `cp.` and `echo`
* Port `cd` to newshell
* Add `~` (paths relative to home) handling in `rz_sys_chdir`
* Add `RZ_NONNULL` for `rz_sys_chdir`
* Port `cat`
* Port `mv` and `mkdir` to new shell; Remove old handlers
* Port `pwd`
* Port `sort`
* Remove `cp.` command
* Add `RZ_NONNULL` for arguments of `rz_syscmd_*` functions
* Port `cls` and `clear`
* cd to home when no argument provided
* Fix `mkdir`
* Add alias handling for `cat`
* Fix `mv` command