Skip to content

Commit

Permalink
Remove workarounds for now fixed DMD bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
bohlender committed Oct 13, 2020
1 parent 19a0c9f commit a0a245f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 21 deletions.
1 change: 0 additions & 1 deletion test/arm64.d
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ void writeDetail(ref OutBuffer buf, in Arm64Instruction instr){
buf.writefln("\t\toperands[%d].type: C-IMM = %d", i, op.imm);
break;
case Arm64OpType.reg_mrs:
// buf.writefln("\t\toperands[%d].type: REG_MRS = 0x%x", i, op.reg.id); // TODO: Should not crash -> use tagged union
buf.writefln("\t\toperands[%d].type: REG_MRS = 0x%x", i, op.reg_mrs);
break;
case Arm64OpType.reg_msr:
Expand Down
8 changes: 2 additions & 6 deletions test/customized_mnem.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,8 @@ enum X86_CODE32 = cast(ubyte[])"\x75\x01";

void writeDisasmOne(ref OutBuffer buf, in CapstoneX86 cs){
auto instrs = cs.disasm(X86_CODE32, 0x1000);
// TODO: DMD v2.083.1 segfaults in build-mode=singleFile when using
// auto codeHex = X86_CODE32.bytesToHex(false);
// buf.writefln("%s\t\t%s\t%s", codeHex, instrs[0].mnemonic, instrs[0].opStr);
foreach(b; X86_CODE32)
buf.write("%02x ".format(b));
buf.writefln("\t\t%s\t%s", instrs[0].mnemonic, instrs[0].opStr);
auto codeHex = X86_CODE32.bytesToHex(false);
buf.writefln("%s\t\t%s\t%s", codeHex, instrs[0].mnemonic, instrs[0].opStr);
}

unittest{
Expand Down
16 changes: 2 additions & 14 deletions test/x86.d
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,8 @@ enum platforms = [
void writeDetail(ref OutBuffer buf, in X86Instruction instr, in CapstoneX86 cs){
auto x86 = instr.detail; //auto x86 = instr.detail.archSpecific;

// TODO: DMD v2.083.1 segfaults in build-mode=singleFile when using
// buf.writefln("\tPrefix:%s", x86.prefix.bytesToHex);
buf.write("\tPrefix:");
foreach(b; x86.prefix)
buf.write("0x%.2x ".format(b));
buf.writefln("");

// TODO: DMD v2.083.1 segfaults in build-mode=singleFile when using
// buf.writefln("\tOpcode:%s", x86.opcode.bytesToHex);
buf.write("\tOpcode:");
foreach(b; x86.opcode)
buf.write("0x%.2x ".format(b));
buf.writefln("");

buf.writefln("\tPrefix:%s", x86.prefix.bytesToHex);
buf.writefln("\tOpcode:%s", x86.opcode.bytesToHex);
buf.writefln("\trex: 0x%x", x86.rex);
buf.writefln("\taddr_size: %d", x86.addrSize);
buf.writefln("\tmodrm: 0x%x", x86.modRM);
Expand Down

0 comments on commit a0a245f

Please sign in to comment.