Skip to content

Add aliases mapping for MIPS & test for id, alias_id#2635

Merged
kabeor merged 5 commits intocapstone-engine:nextfrom
wargio:fix-mips-aliases
Feb 26, 2025
Merged

Add aliases mapping for MIPS & test for id, alias_id#2635
kabeor merged 5 commits intocapstone-engine:nextfrom
wargio:fix-mips-aliases

Conversation

@wargio
Copy link
Copy Markdown
Collaborator

@wargio wargio commented Feb 26, 2025

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

Fix #2634
Fix #2628

When i pushed the new MIPS changes i forgot to map the aliases.

This PR fixes this issue, but also adds support for testing id and alias_id

Before the patch.

$ ./build/cstool -d mipsel64r6 190040ec
 0  19 00 40 ec  lapc   $v0, 0x64
        ID: 99 (addiupc)
        Is alias: 0 (invalid) with REAL operand set
        op_count: 2
                operands[0].type: REG = v0
                operands[0].is_reglist: false
                operands[1].type: IMM = 0x64
                operands[1].is_unsigned: false
        Groups: HasStdEnc HasMips32r6 

After the patch:

$ ./build/cstool -d mipsel64r6 190040ec
 0  19 00 40 ec  lapc   $v0, 0x64
        ID: 99 (addiupc)
        Is alias: 1439 (lapc) with REAL operand set
        op_count: 2
                operands[0].type: REG = v0
                operands[0].is_reglist: false
                operands[1].type: IMM = 0x64
                operands[1].is_unsigned: false
        Groups: HasStdEnc HasMips32r6 

@github-actions github-actions Bot added the Mips Arch label Feb 26, 2025
@wargio wargio changed the title Fix mips aliases Add aliases mapping for MIPS Feb 26, 2025
@github-actions github-actions Bot added Python Bindings java bindings ocaml bindings labels Feb 26, 2025
Comment thread tests/issues/issues.yaml
@wargio wargio changed the title Add aliases mapping for MIPS Add aliases mapping for MIPS & test for id, alias_id Feb 26, 2025
@notxvilka
Copy link
Copy Markdown

notxvilka commented Feb 26, 2025

@kabeor please take a look and merge quickly, it's important for Rizin.

Copy link
Copy Markdown
Member

@kabeor kabeor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged, thanks.

@kabeor kabeor merged commit ace8056 into capstone-engine:next Feb 26, 2025
@wargio wargio deleted the fix-mips-aliases branch February 27, 2025 02:22
kabeor pushed a commit that referenced this pull request Apr 2, 2025
* Fix wrong version requirement of tricore instructions: (#2620)

crc32.b
crc32b.w
crc32l.w
crcn
popcnt.w
shuffle

Remove invalid instruction:
BISR_rc_v161

Learn up misconfigure of nor and not

* Switch to ubuntu-24.04-arm runner image (#2625)

* Build Tarball before DEB/RPM package. (#2627)

Because it was run after the RPM/DEB package build it contained the 'build' directory
with all its files. Which made it way too big.

* Add aliases mapping for MIPS & test for id, alias_id (#2635)

* Add checks for MIPS details on cstest_py (#2640)

* Give the user some guidance where to add missing enumeration values. (#2639)

* - Added missing files for sdist archive (#2624)

* cmake: Fix building capstone as sub-project (#2629)

* cmake: Use PROJECT_SOURCE_DIR instead of CMAKE_SOURCE_DIR

capstone can be built as sub-project through cmake's fetch_content
mechanism. In this case, `CMAKE_SOURCE_DIR` refers to the parent project
(that has nothing to do with capstone), while `PROJECT_SOURCE_DIR` refers
to the root of the capstone source tree.

Recently introduced changes to enable CPack (#2590) are using the wrong
variable and are hence breaking builds that use capstone through
fetch_content. Use the correct variable to fix this issue.

* cmake: Only include cpack in top-level builds

Do not include cpack in builds where capstone is used through
fetch_content.

* Update operand type enums of all arch modules to the one in `capstone.h` (#2633)

* Set all operand types to the main CS_OP_ types from capstone.h.

* Add test cases from issue.

* Enhance shift value and types of shift instructions. (#2638)

* Enhance shift value and types of shift instructions.

Shifts via registers now save the register id in cs_arch64_op.shift.value
and set the shift type accordingly.

* Sort table

* Fix build for compilers requiring explicit static for inline functions.. (#2645)

* Tms32c64x Little Endian (#2648)

* Add little endian support for TMS320c64x.
This requires now to initialize TMS320c64x with the
CS_MODE_BIG_ENDIAN flag.

* Fix typo

* Add Call group to svc, smc and hvc. (#2651)

* Decode BH field in print_insn_detail_ppc (#2662)

---------

Co-authored-by: Changqing  Jing <changqing.jing@bmw.com>
Co-authored-by: @Antelox <anteloxrce@gmail.com>
Co-authored-by: Giovanni <561184+wargio@users.noreply.github.com>
Co-authored-by: Philipp Wagner <mail@philipp-wagner.com>
Co-authored-by: Tim Haines <thaines.astro@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java bindings Mips Arch ocaml bindings Python Bindings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Instructions marked as alias with alias_id 0 negu not detected as alias of subu.

4 participants