-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-Sync Mips #2410
Auto-Sync Mips #2410
Conversation
509ae13
to
0ff1af5
Compare
The auto-sync test is fixed in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed move details to MipsMapping.c
55fdb1f
to
b449bd7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! Awesome job! This was a big one. And it looks great.
Please address the comments.
Also, in the long run we can think about adding the instruction formats as additional information.
LLVM defines them well on a shallow look (the ISA doesn't though). But I like to have them provide them, because if Capstone fails badly to provide certain details, people can extract them by themselves until there is a fix.
Of course referencing MipsInstrFormats.td
.
Also please rebase onto #2456 and generate the yaml tests. The current MC tests can stay as they are. Don't delete them. They are still used by the fuzzer.
9a603cc
to
1256c4e
Compare
* Move patch constraints into the config file and add a test * Handle some Mips operand printer.
a52c901
to
3ea4e9f
Compare
3ea4e9f
to
e231289
Compare
a07829b
to
5e2d6f4
Compare
5e2d6f4
to
07b0be1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok nice. Almost done. Some more nitpicks:
- Please add the resolved issues (from the PR descriptions above) as tests to
tests/issues.yaml
. - Please add the newly added features (
access
,is_reglist
etc.) and new restrictions (checks features more strictly) for Mips indocs/cs_v6_release_guide.md
. - Also document new option (
CS_OPT_SYNTAX_NO_DOLLAR
) andcstool
behavior there.
531e913
to
0d08be8
Compare
diff --git a/suite/auto-sync/src/autosync/cpptranslator/patches/FieldFromInstr.py b/suite/auto-sync/src/autosync/cpptranslator/patches/FieldFromInstr.py
index 67f7faae..58092ea0 100644
--- a/suite/auto-sync/src/autosync/cpptranslator/patches/FieldFromInstr.py
+++ b/suite/auto-sync/src/autosync/cpptranslator/patches/FieldFromInstr.py
@@ -41,9 +41,9 @@ class FieldFromInstr(Patch):
# Determine width of instruction by the variable name.
if ffi_first_arg_text[-2:] == "32":
- inst_width = 4
+ inst_width = b"4"
elif ffi_first_arg_text[-2:] == "16":
- inst_width = 2
+ inst_width = b"2"
else:
# Get the Val/Inst parameter.
# Its type determines the instruction width.
diff --git a/.github/workflows/auto-sync.yml b/.github/workflows/auto-sync.yml
index 9d26470d..d1428d06 100644
--- a/.github/workflows/auto-sync.yml
+++ b/.github/workflows/auto-sync.yml
@@ -101,4 +101,3 @@ jobs:
./src/autosync/cpptranslator/Differ.py -a ARM --check_saved
./src/autosync/cpptranslator/Differ.py -a PPC --check_saved
./src/autosync/cpptranslator/Differ.py -a LoongArch --check_saved
- ./src/autosync/cpptranslator/Differ.py -a Mips --check_saved
|
0d08be8
to
d4c90c1
Compare
@Rot127 fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
Would be nice to get it merged, so Coverity would check this code too, also we could update it in Rizin @kabeor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really awesome, thank you!
Your checklist for this pull request
Detailed description
Adds options for:
CS_OPT_SYNTAX_NOREGNAME
on MipsCS_OPT_SYNTAX_NO_DOLLAR
(new, removes$
from the register)Adds support for:
cstool has been refactored for better UX: now by adding
+<feature>
you can directly modify the output of capstone using all options.For example:
Also fixes the following issues:
Fix MIPS regs_access unsupported #1519
Fix Inconsistent behavior of Mips_option() and other XX_option() #1743
Fix 'regs_access()' is still not supported in MIPS #1869
Fix Wrong disassembly in MIPS32 #1990
Fix MIPS lacks CS_OPT_SYNTAX_NOREGNAME support #1958
Fix MIPS - JAL missing CALL/jump group #2448