* Added a CI-task to check if rizin could be used as subproject
* Fixed some new global-arguments in meson-build
Co-authored-by: amibranch <amibranch@users.noreply.github.com>
* Use pre-v5 enum names which are now supported by compatibility macros.
* Bump CS version to newest next
* Remove Capstone v6 job until v6 patch release is out.
* Check for support of enum compare/conversion warnings.
* Bumps Capstone version to newest Capstone next (beyond first v6-Alpha1).
* Fixes leaks
* Fixes build and change to AArch64 and SystemZ compatibility headers.
* Marks M68k test as broken (see commit message).
* Fix AArch64 and SystemZ tests
* Handle op.size == 0 for x86 IL ops
Uplift Hexagon architecture to RzIL
The general structure is, that every (sub-)instruction has a getter for it's RzIL code.
Calling the getter will return the RzIL operation.
If RzIL for an instruction is requested, the plugin makes a decision. Because Hexagon only executes whole instruction packets. If the instruction is not the last instruction in a packet, it will simply return `EMPTY()`. If the RzIL for the last instruction in a packet is requested, it will get the RzIL operations for all instructions in the packet, shuffles them into the correct execution order (according to some rules) and returns the complete operation for the packet.
The RzIL code was entirely generated with the [rzil-compiler](https://github.com/Rot127/rzil-compiler/), using the semantic definition of the [QEMU Hexagon module](https://github.com/qemu/qemu/tree/master/target/hexagon).
Currently successful compile instructions (and tested):
```
[*] 1581/1733 standard instructions compiled.
[*] 431/643 HVX instructions compiled.
[*] In total: 2012/2376 instructions compiled.
```
It was tested with:
- (Semantic tests) `rz-tracetest` against the execution trace of the QEMU Hexagon test binaries.
- (Bug free and semi-semtantic test) Adding tests which simply execute the test binaries to ensure leak and segfault free execution. Also it is executed until a certain instruction is reached (end of `main` or `loc.pass` symbol), partially testing it executes correctly.
For the uplifting several changes and modernization had to be made:
- Enhance consistency of decoding
- Allow to disassemble an instruction without copying the result. This is used if the given buffer of instruction bytes is larger than one instruction width. In this case, as many instructions as the buffer can hold are disassembled and buffered for later.
- Generally enhance buffering of instructions.
- Allow to mark a packet as valid before it is completely decoded (in case we know it must be valid, e.g. if it is a jump target of a valid packet).
- Fix (hopefully) all memory leaks of the Hexagon plugin.
- Changes to register getters, because RzIL needs finer control to translate alias or explicit register names to their real register.
- Getter for register name is now done by table, so for future distinction between DSP version we can just select another table.
- Translation functions from register alias or explicit name to their real register.
- Each operand contains now it's variable ID (e.g. `d` for register `Rd`) as in the ISA (for mapping in the RzIL code).
- Ease debugging by tracking in more precision, if an instruction is added to a stale, active or new packet.
- Add registers `C20` - `C29` (not yet present in LLVM)
- Some renaming to make the code more readable.
The Thread Sanitizer of ASAN doesn't seem to support
randomized offsets from the VMA base address (`vm.mmap_rnd_bits`)
if they are larger than 28 bits.
This leads to ASAN compiled binaries to crash or endless loop
with a `AddressSanitizer:DEADLYSIGNAL` before main is reached.
Reference issues:
https://github.com/google/sanitizers/issues/1716https://github.com/google/sanitizers/issues/1724
* Remove macros checking for CS_API_VERSION 3
* Remove CS 3 from meson_options and subprojects.
* Remove Capstone v3 from CI
* Remove CS_API_VERSION >= 4 checks since always true from now on.
* Add CSv5 workflow to CI.
* Handle ARM pre v6 build errors.
* Fix PPC build errors for CS < v6
* Fix correct macro name
* Remove wrong include.
* Fix fallthrough warning
* Fix getter macros for WB and post-fix flags.
* Fix faulty macro name
* Check for all float extensions for vabs.
* Add return to assert cases.
* Update cs to 46154e8605aaefdcca5fecf4ea88b92db5a40ad3
* Remove cs3 wrap file.
---------
Co-authored-by: wargio <wargio@libero.it>
* Do not use designater array initializer because MSVC complains
* Add new Appveyor CI test for including C headers from C++ files
* Need to test whether Rizin headers can be included in C++ when
using MSVC, needed for Cutter to build successfully
* Changed the name of `build-cpp` CI job in GitHUb jobs to
`build-cpp-linux` to make it obvious that it only performs the
test for Linux