Enable x86 disassembly in jit compare.

This commit is contained in:
Unknown W. Brackets 2014-10-11 09:06:52 -07:00
parent 6f9ea6ef4b
commit 498d0b9adc

View File

@ -25,6 +25,7 @@
#include "ui/viewgroup.h"
#include "ui/ui.h"
#include "ext/disarm.h"
#include "ext/udis86/udis86.h"
#include "Common/LogManager.h"
#include "Common/CPUDetect.h"
@ -491,7 +492,19 @@ void JitCompareScreen::UpdateDisasm() {
rightDisasm_->Add(new TextView(targetDis[i]));
}
#else
rightDisasm_->Add(new TextView("No x86 disassembler available"));
ud_t ud_obj;
ud_init(&ud_obj);
#ifdef _M_X64
ud_set_mode(&ud_obj, 64);
#endif
ud_set_pc(&ud_obj, (intptr_t)block->normalEntry);
ud_set_vendor(&ud_obj, UD_VENDOR_ANY);
ud_set_syntax(&ud_obj, UD_SYN_INTEL);
ud_set_input_buffer(&ud_obj, block->normalEntry, block->codeSize);
while (ud_disassemble(&ud_obj) != 0) {
rightDisasm_->Add(new TextView(ud_insn_asm(&ud_obj)));
}
#endif
}