* radare2-shell-parser: shrink to single-command output when substituing
Before this patch, when substituing arguments the entire input string
was considered, making the process potentially slow if the input was
long. With this patch, substitute_args and parse_args work on a shrinked
version of the input, which includes only the current command.
Not only it improves performance, but it also prevents issues where
other non-related parts of the input string could be replaced during
apply_edits.
* radare2-shell-parser: implement some iter commands
* Add support for number_command and recursive help
* cmd_ignbithints should be set everywhere for consistency
* Save rnum->value before doing a cmd substitution
* Update radare2-shell-parser to fix null deref in html_disable_command
* Use TSSymbol instead of comparing type strings
This patch uses ts_node_symbol instead of ts_node_type to check whether
a node is of a given type. Since TSSymbol is just an integer, the check
will be much faster. Also, it allows to store commands handler in an
hashtable, instead of having if-cascade.
* Make sure r_config_hold works even when keys do not exist or are freed
* Add support for all _tmp_commands
* Make sure to always reuse the same TSLanguage
* Update both tree-sitter and radare2-shell-parser
This way we use TSLanguage version 11, which fixes some problems with
TSSymbols.
* Compute is_last_cmd on each single command and fix logging
is_last_cmd should be set on a per-command basis, so if you analyze
things like `pd 3; .; .; .;` the `.` refers to `pd 3`.
This also fixes logging, so when an invalid command is parsed, it is
still available in the history.
* Add comment about directly using r2-shell-parser in r_core_cmd_lines
r_core_cmd_lines tries to parse the input and split it in lines, but at
least in theory, we don't need it as the new parser can already handle
full scripts.
* Allow other tasks to run between commands even in the new parser
* Update radare2-shell-parser
* A bit of refactoring in the code that deals with tree-sitter cmds
* Fix redirect_command parsing
* Better handling of last_commands and update radare2-shell-parser
* Fix printing of helps for @, @@, @@@
This feature only works with server implementations that have ReverseStep
and ReverseContinue enabled, such as rr. The official gdbserver doesn't support it.
* Initial implementation of libname for flags in imports
* Initial support for PE and real flag
* Read libname for PE exports
* implement pj for imports
* Remove imp. prefix from symbol names
* Fix r_core_bin_impaddr()
* Fix some mdmp import stuff
* Print libname in ii
* Fix some imp. checks and reloc meta
* Fix r_bin_filter_sym() for imports
* Use realname for noreturn check
* Fix asm.flags.real for direct calls
* Fix realname for direct calls with fcn
* Fix resolving names from ordinal
Co-authored-by: Florian Märkl <info@florianmaerkl.de>
Last release (4.1.0) did compile it by default, but the build requires
internet access to download the repositories. For now, since the feature
is anyway very experimental, we disable it at compile time so that
distributions can just compile their packages without internet access.
In the future we may want to use submodules or augment the release
tarball to include the tree-sitter and radare2-shell-parser archives.
Most servers/clients should have xml support by now so it should behave
like `dp` in any other debugger. vFile is the only way to get detailed pid info unfortunately.
Before we didn't check if a virtual address read/write would go through a page boundary. This fixes it.
Also do some formatting and re-enable some useful error messages
Previously, windbg_break would freeze waiting on a lock instead of breaking,
taks other than wait weren't breakable and read regs would freeze the
process while waiting for a mutex.
Since r2 doesn't support set/get to large/vector registers (it will still work
when printing gdb's registers with dr/drt or restoring the registers
with reverse stepping), there's a possible issue that the user will get
lots of prints of "r_reg_[get/set]_value: Bit size 128 not supported"
when running various debug commands that use those functions. This fix
simply moves those registers away from gpr to avoid those prints while
still being able to view/restore the registers.
Writing registers with gdbr worked with single registers because
reg_next_diff started at delta 0 and only had to run the diff once for
the single register that was changed. When running reverse
stepping/continue, multiple registers are changed at once so
r_reg_next_diff would fail every time due to incorrect offset calculation.
The new r_reg_next_diff also support different register sizes to restore
all registers correctly.
The endianity swapping part from reg_write isn't needed since the arena
is the return value of 'g' which is already in the correct target byte
order (see: https://sourceware.org/gdb/onlinedocs/gdb/Packets.html#read-registers-packet)