This change is to ease the switch to the new parser and make the syntax
more consistent and easy. As things were before this patch, ',' could be
part of an argument of a command, but at the same time it was used as a
separator when defining a new macro. This difference in how `,` is
interpreter, makes parsing commands harder, as grep specifiers,
arguments, etc. should be parsed differently based on whether they are
inside a macro body or not.
By switching to using `;` as separator in the macro body, arguments,
grep specifiers, etc. can be parsed as they would be outside of a macro
body, making the new parser more consistent and easier.
* 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
pd 10 > $foo # save the output of pd 10 into $foo
$foo # print the contents of $foo (the output)
$* # values are now printed in base64
$foo=base64: # is now supported
* Fix r_str_cmp to follow the documented behaviour
Now r_str_cmp behaviour is consistent.
Before:
* Returns true if both pointers are equal.
* Returns false if the strings are equal.
Now:
* Returns true if both pointers are equal.
* Returns true if the strings are equal.
* Implement "rabin2 -L [plugin]"
- Display plugin info in a proper structured way for humans with
"rabin2 -L [plugin]".
- Fix current "rabin2 -L [-j]" output.
- Allow to specify "-j" before or after "-L".
Fix issue #6861.
* Implement command iL [plugin]
* Fix json output in rabin2 -L and iL
Not all fileformats return correct data in Sections, this is
why sometimes the relocation with baddr (needed for aslr) fails
on mach0 for example. This code needs to be redesigned and fixed.