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

capstone: add 5.0.3 version #5474

Merged
merged 8 commits into from
Oct 13, 2024
Merged

capstone: add 5.0.3 version #5474

merged 8 commits into from
Oct 13, 2024

Conversation

star-hengxing
Copy link
Contributor

@star-hengxing star-hengxing commented Oct 11, 2024

No description provided.

@star-hengxing
Copy link
Contributor Author

@waruqi wasm ci 貌似有点问题,我本地 linux/windows 都是可以的。感觉可能是 emsdk 缓存的问题

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


@waruqi wasm There seems to be a problem with ci. It works fine in my local linux/windows. It feels like it may be a cache problem with emsdk

@waruqi
Copy link
Member

waruqi commented Oct 11, 2024

暂时没空看,你先禁用 cache 试下

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


I don’t have time to read it yet, so try disabling cache first.

@luadebug
Copy link
Contributor

luadebug commented Oct 12, 2024

You can improve test if you want to.
https://github.com/Homebrew/homebrew-core/blob/02b96a38c53caf9a97d6edeeb9206a198ba8e6b5/Formula/c/capstone.rb#L39-L62

assert(package:check_csnippets({test = [[
      //code comes from https://www.capstone-engine.org/lang_c.html
      #include <stdio.h>
      #include <inttypes.h>
      #include <capstone/capstone.h>
      #define CODE "\\x55\\x48\\x8b\\x05\\xb8\\x13\\x00\\x00"
      void test()
      {
        csh handle;
        cs_insn *insn;
        size_t count;
        cs_open(CS_ARCH_X86, CS_MODE_64, &handle);
        count = cs_disasm(handle, CODE, sizeof(CODE)-1, 0x1000, 0, &insn);
        if (count > 0) {
          size_t j;
          for (j = 0; j < count; j++) {
            printf("0x%"PRIx64":\\t%s\\t\\t%s\\n", insn[j].address, insn[j].mnemonic,insn[j].op_str);
          }
          cs_free(insn, count);
        } else
          printf("ERROR: Failed to disassemble given code!\\n");
        cs_close(&handle);
      }
]]}, {configs = {languages = "c11"}}))

end)

on_test(function (package)
if package:is_plat(os.host()) then
if not package:is_cross() then
os.vrun("cstool -v")
end
assert(package:has_cfuncs("cs_version", {includes = "capstone/capstone.h"}))
Copy link
Contributor

@luadebug luadebug Oct 12, 2024

Choose a reason for hiding this comment

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

    on_test(function (package)
        if not package:is_cross() then
            os.vrun("cstool -v")
        end
        assert(package:check_csnippets({test = [[
      //code comes from https://www.capstone-engine.org/lang_c.html
      #include <stdio.h>
      #include <inttypes.h>
      #include <capstone/capstone.h>
      #define CODE "\\x55\\x48\\x8b\\x05\\xb8\\x13\\x00\\x00"
      void test()
      {
        csh handle;
        cs_insn *insn;
        size_t count;
        cs_open(CS_ARCH_X86, CS_MODE_64, &handle);
        count = cs_disasm(handle, CODE, sizeof(CODE)-1, 0x1000, 0, &insn);
        if (count > 0) {
          size_t j;
          for (j = 0; j < count; j++) {
            printf("0x%"PRIx64":\\t%s\\t\\t%s\\n", insn[j].address, insn[j].mnemonic,insn[j].op_str);
          }
          cs_free(insn, count);
        } else
          printf("ERROR: Failed to disassemble given code!\\n");
        cs_close(&handle);
      }
        ]]}, {configs = {languages = "c11"}}))
        assert(package:has_cfuncs("cs_version", {includes = "capstone/capstone.h"}))
    end)

//code comes from https://www.capstone-engine.org/lang_c.html

add test if you want to.

@luadebug luadebug mentioned this pull request Oct 12, 2024
@waruqi
Copy link
Member

waruqi commented Oct 13, 2024

禁用 wasm ci cache 后可以

@waruqi waruqi merged commit 97793f8 into dev Oct 13, 2024
4 of 67 checks passed
@waruqi waruqi deleted the capstone branch October 13, 2024 13:47
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


After disabling wasm ci cache, you can

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.

4 participants