Skip to content

Commit

Permalink
Merge branch 'next' of https://github.com/capstone-engine/capstone in…
Browse files Browse the repository at this point in the history
…to v6
  • Loading branch information
saicao committed Apr 25, 2024
2 parents adc6b81 + c4d0993 commit 55d9dd9
Show file tree
Hide file tree
Showing 227 changed files with 13,848 additions and 3,071 deletions.
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_asm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Bug report - Incorrect disassembly
about: Create a report about incorrect disassembly.
---

<!-- This template is meant for disassembly related bug reports, please be as descriptive as possible -->

### Work environment

<!-- Filling this table is mandatory -->

| Questions | Answers
|------------------------------------------|--------------------
| OS/arch/bits | Debian arm 64, MacOS AArch64, MacOS x86, Windows x86 etc.
| Architecture | ppc, x86, cortexm, armv8 etc.
| Source of Capstone | `git clone`, brew, pip, release binaries etc.
| Version/git commit | v5.0.1, <commit hash>

<!-- INCORRECT DISASSEMBLY BUGS -->

### Instruction bytes giving faulty results

```
0x00,0x00,0x00,0x00
```

### Expected results

It should be:
```
<this or that>
```

### Steps to get the wrong result

With `cstool`:

```sh
cstool arm -d 0x00,0x00,0x00,0x00
```

or with `Python`

```python
CODE = b'\x90\x90\x90\x90'

md = Cs(CS_ARCH_ARM, CS_MODE_THUMB)
md.detail = True
for insn in md.disasm(CODE, 0x1000):
# Print the faulty disassembly
```

<!-- ADDITIONAL CONTEXT -->

### Additional Logs, screenshots, source code, configuration dump, ...

Drag and drop zip archives containing the Additional info here, don't use external services or link.
Screenshots can be directly dropped here.
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_general.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug report - Other bugs
about: Create a report to help us improve

---

<!-- This template is meant for GENERAL bug reports.
For bugs regarding incorrect disassembly,
please use the "Bug report - Incorrect disassembly" template.
Please be as descriptive as possible
-->

### Work environment

<!-- Filling this table is mandatory -->

| Questions | Answers
|------------------------------------------|--------------------
| OS/arch/bits | Debian arm 64, MacOS AArch64, MacOS x86, Windows x86 etc.
| Architecture | ppc, x86, cortexm, armv8 etc.
| Source of Capstone | `git clone`, brew, pip, release binaries etc.
| Version/git commit | v5.0.1, <commit hash>

<!-- OTHER BUGS -->

### Expected behavior

### Actual behavior

### Steps to reproduce the behavior

- Use code markdown `CODE` to make your code visible

<!-- ADDITIONAL CONTEXT -->

### Additional Logs, screenshots, source code, configuration dump, ...

Drag and drop zip archives containing the Additional info here, don't use external services or link.
Screenshots can be directly dropped here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Feature request
about: Suggest an idea for this project

---

### Feature

- [ ] New architecture module
- [ ] Support for processor extension
- [ ] Add more instruction details (elaborated below)
- [ ] Binding support for: `language`
- [ ] Other (elaborated below)

**Describe the feature you'd like**
A clear and concise description of what you want to happen.

**Additional context**
Add any other context about the feature request here.
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- Filling this template is mandatory -->

**Your checklist for this pull request**
- [ ] I've documented or updated the documentation of every API function and struct this PR changes.
- [ ] I've added tests that prove my fix is effective or that my feature works (if possible)

**Detailed description**

<!-- Explain the **details** for making this change. Is a new feature implemented? What existing problem does the pull request solve? How does the pull request solve these issues? Please provide enough information so that others can review your pull request. -->

...

**Test plan**

<!-- What steps should the reviewer take to test your pull request? Demonstrate the code is solid. Or what test cases you added. Disassembly tests should be added in suite/cs_test/issues.cs -->

...

**Closing issues**

<!-- put "closes #XXXX" in your comment to auto-close the issue that your PR fixes (if any). -->

...
7 changes: 7 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ EVM:
- include/capstone/evm.h
- tests/test_evm.c

HPPA:
- arch/HPPA/*
- cstool/cstool_hppa.c
- include/capstone/hppa.h
- suite/MC/HPPA/*
- tests/test_hppa.c

M680X:
- arch/M680X/*
- cstool/cstool_m680x.c
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/CITest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ jobs:
cp libcapstone.* ../tests/
cp test_* ../tests/
- name: cstool - reaches disassembler engine
run: |
sh suite/run_invalid_cstool.sh
- name: cstest
run: |
cd suite/cstest && ./build_cstest.sh
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/auto-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Auto-Sync
on:
push:
paths:
- "suite/auto-sync/**"
pull_request:

jobs:
check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: suite/auto-sync/
steps:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Check out repository
uses: actions/checkout@v4
with:
submodules: true

- name: Install auto-sync package
run: |
pip install .
- name: Check formatting
run: |
python3.11 -m black --check src/autosync
- name: Build llvm-tblgen
run: |
git clone https://github.com/capstone-engine/llvm-capstone.git vendor/llvm_root
cd vendor/llvm_root
mkdir build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ../llvm
cmake --build . --target llvm-tblgen --config Debug
cd ../../../
- name: Test generation of inc files
run: |
./src/autosync/ASUpdater.py -d -a AArch64 -s IncGen
./src/autosync/ASUpdater.py -d -a Alpha -s IncGen
./src/autosync/ASUpdater.py -d -a ARM -s IncGen
./src/autosync/ASUpdater.py -d -a PPC -s IncGen
- name: CppTranslator - Patch tests
run: |
python -m unittest src/autosync/cpptranslator/Tests/test_patches.py
- name: CppTranslator - Differ tests
run: |
python -m unittest src/autosync/cpptranslator/Tests/test_differ.py
- name: CppTranslator - Test translation
run: |
./src/autosync/ASUpdater.py --ci -d -a AArch64 -s Translate
./src/autosync/ASUpdater.py --ci -d -a ARM -s Translate
./src/autosync/ASUpdater.py --ci -d -a PPC -s Translate
- name: Test Header patcher
run: |
python -m unittest src/autosync/Tests/test_header_patcher.py
4 changes: 2 additions & 2 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.14.1
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
CIBW_ARCHS_LINUX: "x86_64 i686 aarch64" # ppc64le s390x really slow
Expand Down Expand Up @@ -82,4 +82,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_pass }}
password: ${{ secrets.pypi_pass }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ tests/test_bpf
tests/test_sh
tests/test_riscv
tests/test_sh
tests/test_alpha
tests/test_hppa

# regress binaries
suite/regress/invalid_read_in_print_operand
Expand Down Expand Up @@ -144,3 +146,5 @@ android-ndk-*

# Meson
/subprojects/fadec/
# Auto-sync files
suite/auto-sync/src/autosync.egg-info
20 changes: 20 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: CapstoneEngine
Source: https://github.com/capstone-engine/capstone

Files: src/autosync/cpptranslator/Tests/test_config.json
Copyright: 2022 Rot127 <[email protected]>
License: BSD-3

Files: src/autosync/cpptranslator/arch_config.json
Copyright: 2022 Rot127 <[email protected]>
License: BSD-3

Files: src/autosync/cpptranslator/saved_patches.json
Copyright: 2022 Rot127 <[email protected]>
License: BSD-3

Files: src/autosync/path_vars.json
Copyright: 2022 Rot127 <[email protected]>
License: BSD-3

9 changes: 9 additions & 0 deletions .reuse/templates/license-template.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% for copyright_line in copyright_lines %}
{{ copyright_line }}
{% endfor %}
{% for contributor_line in contributor_lines %}
SPDX-FileContributor: {{ contributor_line }}
{% endfor %}
{% for expression in spdx_expressions %}
SPDX-License-Identifier: {{ expression }}
{% endfor %}
Loading

0 comments on commit 55d9dd9

Please sign in to comment.