Commit Graph

5218 Commits

Author SHA1 Message Date
Rot127
191db14531
Modern Testing (#2456) 2024-08-31 21:33:38 +08:00
Rot127
df72286749
Use any-glob for labeler. Otherwise it is not checked recursively. (#2450) 2024-08-19 16:33:37 +08:00
Rot127
42d3acf5ec
[next] Wheel build fixes: manylinux1, trigger upload on release, Linux AArch64... (#2444)
* Add AArch64 linux build again.

* Enable package build also for PRs and pushes.

* Fix: don't append python version to injected platform name.

* Add musllinux build to wheel checking script

* Trigger wheel upload only on published full-releases.

* Remove duplicate workflow file

* Ensure all artifacts are moved to the same directory 'dist'

* Enable verbose twine upload.

* Add step to show downloaded artifacts for debugging.
2024-08-19 16:33:08 +08:00
Rot127
7149ec8dca
Update and add labels (#2446) 2024-08-19 10:52:41 +08:00
Mario Haustein
78eee139f4
Fix 'make check' for python tests (#2439) 2024-08-19 10:50:29 +08:00
Duncan Ogilvie
f38d56b692
Add back support for relocatable packages (#2431) 2024-08-17 23:54:12 +08:00
Rot127
5e6807bab9
[next] Updates and fixes to the Python wheel builder workflow (#2441) 2024-08-15 20:57:23 +08:00
Rot127
1f0087a7a2
Add Coverity workflow (#2437) 2024-08-13 12:25:50 +08:00
luozexuan
edbcf9e017
chore: fix some comments (#2432)
Signed-off-by: luozexuan <fetchcode@139.com>
2024-08-12 12:01:22 +08:00
Rot127
d713dda315
Fix CI fuzz job yml syntax (#2429) 2024-08-08 18:27:19 +08:00
david942j
4c629d9be1
[next] Fix unintended zero set in Sparc printInst (#2421) 2024-08-04 18:46:43 +08:00
Rot127
3a0c96c689
Add release wheel build workflow for all Python versions (#2414) 2024-08-01 12:02:22 +08:00
david942j
c666fbdb74
Fix typo in AArch64 Python binding (#2413) 2024-08-01 11:58:47 +08:00
Sahil Siddiq
4f964a264e
Fix incorrect operand in disassembled instruction (#2401) (#2403)
Disassembling the "slwi", "srwi" and "rldicr" PowerPC instructions
with the "-d" option displays the wrong operands in the detailed
view. This is due to an incorrect break condition in the
"PPC_insert_detail_op_imm_at" function.

This patch fixes #2401.
2024-07-24 14:19:39 +08:00
Rot127
5ba4ca4ba6
Merge pull request #2396 from twizmwazin/python/remove-deprecated-packaging
Python/remove deprecated packaging
2024-07-19 14:04:16 +00:00
Kevin Phoenix
8ddb2b971f Update setup.py to reflect minimum python 3.8 2024-07-16 12:26:15 -07:00
Richard Henderson
de5120ed0c
Constify three ARM and AArch64 variables (#2399)
* arm: Constify arm_flag_regs

* aarch64: Constify aarch64_flag_regs and aarch64_flag_sys_regs
2024-07-16 17:20:10 +08:00
Kevin Phoenix
f9949e567c Remove cython bindings 2024-07-15 12:16:13 -07:00
Kevin Phoenix
2b3383d0f6 Only test python 3.8 and 3.12 2024-07-15 12:14:03 -07:00
Kevin Phoenix
7891cbe5b5 Install importlib_resources with cython bindings 2024-07-15 12:14:03 -07:00
Kevin Phoenix
fd91c20c64 Remove bindings/cython/capstone.egg-info 2024-07-15 12:14:03 -07:00
Kevin Phoenix
adfcba3c92 Undelete ccapstone.pyx 2024-07-15 12:14:03 -07:00
Kevin Phoenix
46be9c02a3 Fix test file path 2024-07-15 12:14:03 -07:00
Kevin Phoenix
6f96163adc Seperate cython bindings into seperate bindings package 2024-07-15 12:14:03 -07:00
Kevin Phoenix
add1659f32 Move python tests to test directory 2024-07-15 12:14:03 -07:00
Kevin Phoenix
bb1084523a Remove python tests from main CI 2024-07-15 12:14:03 -07:00
Kevin Phoenix
dfdd331b8d Use ilammy/msvc-dev-cmd in python tests 2024-07-15 12:14:03 -07:00
Kevin Phoenix
0cca459683 Drop python 3.7 2024-07-15 12:14:03 -07:00
Kevin Phoenix
9858c06111 Seperate windows install to activate vcvars64 2024-07-15 12:14:03 -07:00
Kevin Phoenix
60907d2288 Use older ubuntu to support python 3.7 2024-07-15 12:14:03 -07:00
Kevin Phoenix
2bd76ee987 Fix test_all.py path 2024-07-15 12:14:03 -07:00
Kevin Phoenix
63284d4643 Add simpler python CI 2024-07-15 12:14:03 -07:00
Kevin Phoenix
19ce4baaf5 Disable zip_safe 2024-07-15 12:14:03 -07:00
Kevin Phoenix
16d56703a3 Cast resources path to str 2024-07-15 12:14:03 -07:00
Kevin Phoenix
9237f6d84d Install importlib_resources in the CI 2024-07-15 12:14:03 -07:00
Kevin Phoenix
95f82446c1 Remove PurePath() call breaking .join() 2024-07-15 12:14:03 -07:00
Kevin Phoenix
9d7bd099ac Add tests for python 3.7, 3.8, 3.10 2024-07-15 12:14:03 -07:00
Kevin Phoenix
f23d862b03 Use importlib_resources on python<3.9 2024-07-15 12:14:03 -07:00
Pyrox
0acbec877a Fix cython bindings 2024-07-15 12:14:03 -07:00
Pyrox
c427b3a799 Fix fuzz tests in CI 2024-07-15 12:14:03 -07:00
Pyrox
402df98f80 Add setuptools to python bindings tests
Needed to fix a setuptools error on python 3.9
2024-07-15 12:14:03 -07:00
Pyrox
d9ead27248 Remove python 3.6 from CI Tests
Since support is removed per maintainer request, this should be removed
from the test suite as well.
2024-07-15 12:14:03 -07:00
Pyrox
b555844526 Remove distutils
Removes distutils from the setup.py script for the python bindings, as
it is removed in Python 3.12 onwards.
2024-07-15 12:14:03 -07:00
Kevin Phoenix
9a8f189a0a Remove pkg_resources 2024-07-15 12:14:03 -07:00
Kevin Phoenix
7aca280b7d Create pyproject.toml and add python 3.12 to CI 2024-07-15 12:14:03 -07:00
wxrdnx
404912f068
Add access support for RISC-V (#2393)
* resolve conflict for loongarch and RISCV in Mapping.c and Mapping.h

* Use RISCV_get_detail for simplicity

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>

* Use detail_is_set for simplicity

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>

* Change comment style

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>

* remove redundant add_str

* fix bug for RISCV_add_detail

* fix operands for csr instructions

* add python binding and tester for RISC-V

* add more test cases for RISC-V (M,A,F,D,C instructions)

* fix incorrect operand and access for sc.w and sc.d

* fix incorrect operand for fence and sfence.vma

* assert -> CS_ASSERT

* some instructions in test_riscv.c should be RISCV64

* add cs details test

* update python testers

---------

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>
2024-07-10 11:36:39 +08:00
Rot127
9c5b48b57f
AArch64 update to LLVM 18 (#2298)
* Run clang-format

* Remove arm.h header from AArch64 files

* Update all AArch64 module files to LLVM-18.

* Add check if the differs save file is up-to-date with the current files.

* Add new generator for MC test trnaslation.

* Fix warnings

* Update generated AsmWriter files

* Remove unused variable

* Change MCPhysReg type to int16_t as LLVM 18 dictates.

With LLVM 18 the MCPhysReg value's type is changed to int16_t.
If we update modules to LLVM 18, they will generate
compiler warnings that uint16_t* should not be casted to int16_t*.

This makes changing the all tables to int16_t necessary, because the alternative is
to duplicate all MCPhysReg related code. Which is even worse.

* Assign enum values to raw_struct member

* Add printAdrAdrpLabel def

* Add header to regression test files.

* Write files to build dir and ignore more parsing errors.

* Fix parsing of MC test files.

* Reset parser after every block

* Add write and patch header step.

* Add and update MC tests for AArch64

* Fix clang-tidy warnings

* Don't warn about padding issues.

They break automatically initialized structs we can not change easily.

* Fix: Incorrect access of LLVM instruction descriptions.

* Initialize DecoderComplete flag

* Add more mapping and flag details

* Add function to get MCInstDesc from table

* Fix incorrect memory operand access types.

* Fix test where memory was not written, ut only read.

* Attempt to fix Windows build

* Fix 2268

The enum values were different and hence lead to different decoding.

* Refactor SME operands.

- Splits SME operands in Matrix and Predicate operands.
- Fixes general problems of incorrect detections with
the vector select/index operands of predicate registers.
- Simplifies code.

* Fix up typo in WRITE

* Print actual path to struct fields

* Add Registers of SME operands to the reg-read list

* Add tests for SME operands.

* Use Capstone reg enum for comparison

* Fix tests: 'Vector arra...' to 'operands[x].vas'

* Add the developer fuzz option.

* Fix Python bindings for SME operands

* Fix variable shadowing.

* Fix clang-tidy warnings

* Add missing break.

* Fix varg usage

* Brackets for case

* Handle AArch64_OP_GROUP_AdrAdrpLabel

* Fix endian issue with fuzzing start bytes

* Move previous sme.pred to it's own operand type.

* Fix calculation for imm ranges

* Print list member flag

* Fix up operand strings for cstest

* Do only a shallow clone of the cmocka stable branch

* Fix: Don't categorize ZT0 as a SME matrix operand.

* Remove unused code.

* Add flag to distinguish Vn and Qn registers.

* Add all registers to detail struct, even if emitted in the asm text

* Fix: Increment op count after each list member is added.

* Remove implicit write to NZCV for MSR Imm instructions.

* Handle several alias operands.

* Add details for zero alias with za0.h

* Add SME tile to write list if written

* Add write access flags to operands which are zeroed.

* Add SME tests of #2285

* Fix tests with latest syntax changes.

* Fix segfault if memory operand is only a label without register.

* Fix python bindings

* Attempt to fix clang-tidy warning for some configurations.

* Add missing test file (accidentially blocked by gitignore.)

* Print clang-tidy version before linting.

* Update differ save file

* Formatting

* Use clang-tidy-15 as if possible.

* Remove search patterns for MC tests, since they need to be reworked anyways.

* Enum to upper case change

* Add information to read the OSS fuzz result.

* Fix special case of SVE2 operands.

Apparently ZT0 registers can an index attached,
get which is BOUND to it. We have no "index for reg" field.
So it is simply saved as an immediate.

* Handle LLVM expressions without asserts.

* Ensure choices are always saved.

* OP_GROUP enums can't be all upper case because they contain type information.

* Fix compatibility header patching

* Update saved_choices.json

* Allow mode == None in test_corpus
2024-07-08 10:28:54 +08:00
Kevin Phoenix
8ce088bf58
Python2 leftovers v2 (#2395)
* Remove python2 leftovers
* Remove python2 references from BUILDING.txt
* Remove some leftover install3 references
* Update shebangs to python3
* Delete suite/test_corpus.py
2024-07-01 14:10:12 +08:00
Chen
95966a1393
Initial auto-sync LoongArch support (#2349)
* Initial auto-sync LoongArch support

- Accompanied llvm changes: https://github.com/capstone-engine/llvm-capstone/pull/45
- MC Tests are generated from llvm
- Instruction groups are implemented
- Register accesses are implemented
- Memory operands are handled for memory instructions
- Code are formatted using clang-format of LLVM 17
- Import tests from LLVM MC
- Collect operand type and access
- Collect registers read/modified
---------
Co-authored-by: CoA <1109673069@qq.com>

* Ensure same indent for all patched lines.
* Emit upper case OP_GROUP enum
* Spell all enum values in capital letters.
* Capticalize enums in loongarch_detail.c
* Add test which contains now a tab.
* Run clang-format on test_loongarch.c
---------
Co-authored-by: CoA <1109673069@qq.com>
Co-authored-by: Rot127 <unisono@quyllur.org>
2024-06-26 14:47:44 +08:00
Wu ChenXu
a3fd6ac3a4
Revert "Remove python2 leftovers (#2378)" (#2391)
This reverts commit 60d5b7ec2f.
2024-06-24 16:42:27 +08:00