Skip to content

Commit

Permalink
Update capstone next to use CS_OPT_SYNTAX_NO_DOLLAR on loongarch (#4827)
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio authored Jan 7, 2025
1 parent ad74df5 commit 14eecce
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 7 additions & 1 deletion librz/arch/isa/loongarch/loongarch.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ loongarch_setup_cs_handle(RzAsmLoongArchContext *ctx, bool is_64_bits, bool big_
err = cs_option(ctx->h, CS_OPT_DETAIL, CS_OPT_ON);
if (err) {
const char *error_str = cs_strerror(err);
RZ_LOG_ERROR("Failed on cs_option() with error returned: %u: %s\n", err, error_str);
RZ_LOG_ERROR("Failed on cs_option(CS_OPT_DETAIL, CS_OPT_ON) with error returned: %u: %s\n", err, error_str);
return false;
}
err = cs_option(ctx->h, CS_OPT_SYNTAX, CS_OPT_SYNTAX_NO_DOLLAR);
if (err) {
const char *error_str = cs_strerror(err);
RZ_LOG_ERROR("Failed on cs_option(CS_OPT_SYNTAX, CS_OPT_SYNTAX_NO_DOLLAR) with error returned: %u: %s\n", err, error_str);
return false;
}
return true;
Expand Down
6 changes: 0 additions & 6 deletions librz/arch/p/asm/asm_loongarch_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@ static int disassemble(RzAsm *a, RzAsmOp *op, const ut8 *buf, int len) {
rz_asm_op_setf_asm(op, "%s%s%s",
ctx->insn->mnemonic, RZ_STR_ISNOTEMPTY(ctx->insn->op_str) ? " " : "", ctx->insn->op_str);

char *str = rz_asm_op_get_asm(op);
if (str) {
// remove the '$'<registername> in the string
rz_str_replace_char(str, '$', 0);
}

beach:
cs_free(ctx->insn, ctx->count);
ctx->insn = NULL;
Expand Down
2 changes: 1 addition & 1 deletion subprojects/capstone-next.wrap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[wrap-git]
url = https://github.com/capstone-engine/capstone.git
revision = 9907b22d33693f3beb4b8b7ba261fbdd219afee3
revision = b102f1b89e0455c072a751d287ab64378c14205f
directory = capstone-next
patch_directory = capstone-next
depth = 1

0 comments on commit 14eecce

Please sign in to comment.