371 Commits

Author SHA1 Message Date
Riccardo Schirone
06ab29b93c
Compile new shell parser by default (#16660)
* Move radare2-shell-parser/tree-sitter into shlr
* compile new shell parser by default, available with cfg.newshell variable
* Add README for radare2-shell-parser
* Improve CI
* Add gitattributes file
2020-04-21 13:44:30 +02:00
Liumeo
724d3f7685
Update repository links (#16663) 2020-04-21 11:41:19 +08:00
Riccardo Schirone
784aa48c05
Fix cmd_substitution in grep_specifier ##newshell (#16625)
* Allow cmd_substitution in grep_specifier and set core->tmpseek
2020-04-18 11:07:25 +02:00
Riccardo Schirone
58cbee4144
Add support for foreach commands ##newshell (#16607) 2020-04-17 10:33:45 +02:00
Riccardo Schirone
b4b3013197
Add support for pf commands (#16586) 2020-04-16 13:23:54 +08:00
radare
5a1df188f6
Build fixes to make emscripten builds happy (#16406) ##build 2020-04-02 17:52:03 +02:00
Riccardo Schirone
0cd90b6b7e Update radare2-shell-parser for new macro syntax and fix tests 2020-03-24 15:23:35 +01:00
radare
5e1d5faebd
Support iter_hit_command and update radare2-shell-parser (#16132) ##core 2020-03-05 14:41:37 +01:00
Riccardo Schirone
d88a76d2df
tree-sitter: support iter commands (#16111) ##core
* 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
2020-03-03 12:42:38 +01:00
pancake
22ac83ca8a Upgrade capstone v4 and next branches 2020-02-25 02:36:56 +01:00
Riccardo Schirone
f322c1b1bc
Add support for @* commands in new r2-shell-parser (#16038)
* 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
2020-02-24 09:46:15 +01:00
Riccardo Schirone
a295504570 Use the "concatenation" concept in radare2-shell-parser 2020-02-20 00:35:41 +01:00
Riccardo Schirone
78db2b12dc new parser: fix multiple words in grep and add support for > $alias 2020-02-14 16:29:36 +01:00
Riccardo Schirone
037a521d39
Use state struct and start handling cmd_substition_arg in tree-sitter (#15966) ##core
* Fix escape/unescape in new shell parser
2020-02-13 20:41:00 +01:00
Riccardo Schirone
65d959f299
Run a travis job that uses the radare2-shell-parser (#15879)
* Run a travis job to use the radare2-shell-parser
* radare2-shell-parser: add support for grep_commands, pipes, and others
2020-01-23 09:10:28 +01:00
Riccardo Schirone
6c2ed0d81b
Update radare2-shell-parser and improve tree-sitter related code in cmd.c (#15875)
* 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 @, @@, @@@
2020-01-22 11:05:24 +01:00
Riccardo Schirone
f410795ec4 Update radare2-shell-parser 2020-01-19 22:57:40 +01:00
Riccardo Schirone
46e0a8d169
Do not compile radare2-shell-parser by default (#15769)
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.
2020-01-07 13:37:04 +01:00
radare
38b5791b63
More improvements for the cmd tests using r2r.v (#15728) 2019-12-30 15:33:09 +01:00
Riccardo Schirone
595cb21ad4 Compile tree-sitter with std=c99 flag (#15654) 2019-12-16 23:21:43 +01:00
pancake
f0998c01b7 Update capstone v4/next from Git 2019-11-10 19:05:08 +01:00
Riccardo Schirone
4ebd400fa7
Very simple tree sitter integration (#15414) ##command
* tree-sitter-integration: support tmp-seek, arged, and interpret commands
* Make meson automatically download tree-sitter and radare2-shell-parser grammar
* Add tree-sitter/radare2-shell-parser directories in gitignore
* Add Support for tree-sitter in acr/makefile
* Just use one script to download 3rd party repositories in shlr
* Use cfg.newshell
2019-11-06 10:33:23 +01:00
Florian Märkl
281dd5b794
Update SDB URLs (#15357) 2019-10-25 15:58:29 +02:00
pancake
37abed265d Update capstone from git 2019-10-08 19:39:26 +02:00
Remco Verhoef
80511aac77 Fix macOS build with latest XCode ##build (#15202) 2019-10-08 10:55:31 +02:00
radare
87308db077
Update capstone again (#14862) 2019-08-21 12:40:20 +02:00
radare
8915a0a515
Update capstone (#14780) 2019-08-10 00:07:36 +02:00
radare
c93c094c40
Fix android-static ##build 2019-08-01 04:39:40 +02:00
Florian Märkl
24d3a9cb5d Add r_parse_ctype ##parse (#14596)
* Add r_parse_ctype

* Add mpc to acr

* Readability

* Fix r_parse for acr
2019-07-20 12:50:27 +02:00
pancake
b32a09db05 Update capstone v4 and next 2019-07-18 04:06:01 +02:00
pancake
6b634e2889 Upgrade capstone-next 2019-06-21 10:49:37 +02:00
pancake
0b7ad22f8c Upgrade capstone from git 2019-06-07 14:34:17 +02:00
radare
581609fad2
Update capstone from Git (#14175) 2019-05-28 15:53:30 +02:00
pancake
5d3706bc3c Update capstone5 from git 2019-05-20 18:34:11 +02:00
Sergi Àlvarez i Capilla
6b5905d4f4 Upgrade cs5 to fix the arm64 disasm crash 2019-05-15 15:56:00 +02:00
radare
8ea835076a
Upgrade capstone-next and v4 (#14074) 2019-05-15 08:45:21 +02:00
radare
c5f4266f45
Fix spp warnigs (#14059) 2019-05-14 01:38:17 +02:00
pancake
59c59afedd Upgrade capstone to fix the xacquire x86-64 prefix 2019-05-13 15:30:15 +02:00
radare
12c824cfd1
Automatically choose wget/curl/git depending on availability ##build
* wget/curl downloads use CS_ARCHIVE
* Code cleanup in capstone.sh
2019-05-13 10:25:17 +02:00
pancake
6f565adc2d Update capstone v4 and next branches 2019-05-10 13:43:23 +02:00
Anton Kochkov
36e9d25068 Ability to download capstone git as zip 2019-05-10 09:49:05 +02:00
radare
869b698c1c
Enable capstone5 at configure time option ##disasm
* Add --with-capstone5 configure flag
* Add use_capstone5 meson option
2019-05-07 12:47:27 +02:00
radare
dba7a43f1d
Rollback to capstone4 until all bugs get fixed 2019-04-12 16:13:35 +02:00
radare
0ed7742073
Update capstone to use the NEXT branch ##disasm 2019-04-12 11:24:08 +02:00
radare
f6457c96aa
Update capstone-master (#13496) 2019-03-25 10:56:54 +01:00
pancake
08aec4a431 Update sdb from git 2019-03-18 10:38:00 +01:00
pancake
a4dea9f266 Update capstone from git 2019-03-11 23:26:00 +01:00
Jörg Thalheim
8dbc4f4ebe Fix offline build: Remove duplicated curl line ##build
If the user already provides a capstone tarball, the buildsystem should not try
to download it again.
2019-02-21 10:20:55 +01:00
pancake
c5c93e6ff4 Upgrade capstone-master 2019-02-18 22:00:44 +01:00
radare
6290e4ff4c
Fix #13087 - Automatic NORELEASE mode, use curl if no wget ##build 2019-02-18 19:38:55 +01:00