Skip to content
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

Add webassembly arch #1359

Merged
merged 54 commits into from
Feb 1, 2019
Merged

Add webassembly arch #1359

merged 54 commits into from
Feb 1, 2019

Conversation

SpikeI
Copy link
Contributor

@SpikeI SpikeI commented Feb 1, 2019

Add webassembly arch

aquynh and others added 30 commits December 27, 2018 09:41
Commit 0a39b78 fixed the pkg-config include path when using cmake.
However it didn't fix it for the Makefile.  This fixes the Makefile
path.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Commit 0a39b78 fixed the pkg-config include path when using cmake.
However it didn't fix it for the Makefile.  This fixes the Makefile
path.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
* Bump the "cs_insn.bytes[]" size to 24 (from 16) to support M680x0 instructions with full EA (maximum 11 words)
Added a test for this in test_m68k.s

* Bump the "cs_detail.regs_read[]" size to 16 (from 12) to support M680x0 instructions with full REG_BITS (Dn+An = 16)

* m68k: use immediate mode syntax (#$0) for movem/fmovem instructions with empty register list

* update bindings to match changes to cs_insn and cs_detail
* Bump the "cs_insn.bytes[]" size to 24 (from 16) to support M680x0 instructions with full EA (maximum 11 words)
Added a test for this in test_m68k.s

* Bump the "cs_detail.regs_read[]" size to 16 (from 12) to support M680x0 instructions with full REG_BITS (Dn+An = 16)

* m68k: use immediate mode syntax (#$0) for movem/fmovem instructions with empty register list

* update bindings to match changes to cs_insn and cs_detail
@aquynh aquynh merged commit 4ae8645 into capstone-engine:next Feb 1, 2019
@aquynh
Copy link
Collaborator

aquynh commented Feb 1, 2019

merged, thanks for this amazing work!

@aquynh
Copy link
Collaborator

aquynh commented Feb 1, 2019

look forward to having Python binding support for Web Assembly next!

@@ -119,7 +121,7 @@ set(HEADERS_COMMON
set(TEST_SOURCES test_basic.c test_detail.c test_skipdata.c test_iter.c)

## architecture support
if (CAPSTONE_ARM_SUPPORT)
if (NOT CAPSTONE_X86_ONLY AND CAPSTONE_ARM_SUPPORT)
Copy link
Contributor

Choose a reason for hiding this comment

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

all this seems unrelated to the pr

Copy link
Collaborator

Choose a reason for hiding this comment

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

he ported his pull req from older branch, so mixed up with newer code. this is from old unrelated commit, but still shows up here

@@ -66,8 +66,7 @@ void printInt64Bang(SStream *O, int64_t val)
SStream_concat(O, "#-0x%"PRIx64, (uint64_t)val);
else
SStream_concat(O, "#-0x%"PRIx64, (uint64_t)-val);
}
else
} else
Copy link
Contributor

Choose a reason for hiding this comment

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

changing coding style? is the capstone coding style documented anywhere?

Copy link
Collaborator

Choose a reason for hiding this comment

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

no, we always use Linux kernel style. i just updated HACK.TXT with this info: 864595c

SStream_concat(O, WASM_insn_name((csh)MI->csh, MI->Opcode));

switch (MI->wasm_data.type) {
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is placing the default case at the beginning also part of the capstone coding style? didn't saw that before

Copy link
Collaborator

Choose a reason for hiding this comment

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

i am not sure if Linux kernel coding style follows this, but personally i find that having default case at the top is easier to track.

else
return insn_name_maps[id].name;
#else
return NULL;
Copy link
Contributor

Choose a reason for hiding this comment

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

in diet mode wasm disassembler not work

Copy link
Collaborator

Choose a reason for hiding this comment

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

@SpikeI can you take a look at Diet mode?

@@ -129,8 +129,8 @@
# Capstone C interface

# API version
CS_API_MAJOR = 4
CS_API_MINOR = 1
CS_API_MAJOR = 5
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated to the pr

Copy link
Collaborator

Choose a reason for hiding this comment

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

this is the same issue: older commits shows up here.

case CS_ARCH_MOS65XX:
for (i = 0; i < insn->detail->m680x.op_count; i++)
if (insn->detail->m680x.operands[i].type == (m680x_op_type)op_type)
count++;
break;
case CS_ARCH_WASM:
#if 0
Copy link
Contributor

Choose a reason for hiding this comment

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

dead code

Copy link
Collaborator

Choose a reason for hiding this comment

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

fixed with ee8bcfd

printf("cstool for Capstone Disassembler, v%u.%u.%u\n\n", CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA);
printf("Syntax: %s [-d|-u|-s|-v] <arch+mode> <assembly-hexstring> [start-address-in-hex-format]\n", prog);
printf("Cstool for Capstone Disassembler Engine v%u.%u.%u\n\n", CS_VERSION_MAJOR, CS_VERSION_MINOR, CS_VERSION_EXTRA);
printf("Syntax: %s [-u|-d|-s|-v] <arch+mode> <assembly-hexstring> [start-address-in-hex-format]\n", prog);
Copy link
Contributor

Choose a reason for hiding this comment

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

flags sohuld be sorted alphabetically, and this change is unrelated to the pr

Copy link
Collaborator

Choose a reason for hiding this comment

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

i will fix the flag issue

Copy link
Collaborator

Choose a reason for hiding this comment

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

see 5ae5909

@riptl riptl mentioned this pull request Jul 22, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants