From 4a16efa3e43e35f0cc9efe3a67f620f0017c3d36 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 8 Apr 2013 18:41:23 +0000 Subject: Vendor import of llvm trunk r178860: http://llvm.org/svn/llvm-project/llvm/trunk@178860 --- bindings/python/llvm/disassembler.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'bindings/python/llvm/disassembler.py') diff --git a/bindings/python/llvm/disassembler.py b/bindings/python/llvm/disassembler.py index 5030b989a9443..dcef9ac269058 100644 --- a/bindings/python/llvm/disassembler.py +++ b/bindings/python/llvm/disassembler.py @@ -31,6 +31,9 @@ __all__ = [ lib = get_library() callbacks = {} +# Constants for set_options +Option_UseMarkup = 1 + class Disassembler(LLVMObject): """Represents a disassembler instance. @@ -113,6 +116,10 @@ class Disassembler(LLVMObject): address += result offset += result + def set_options(self, options): + if not lib.LLVMSetDisasmOptions(self, options): + raise Exception('Unable to set all disassembler options in %i' % options) + def register_library(library): library.LLVMCreateDisasm.argtypes = [c_char_p, c_void_p, c_int, @@ -125,6 +132,10 @@ def register_library(library): c_uint64, c_uint64, c_char_p, c_size_t] library.LLVMDisasmInstruction.restype = c_size_t + library.LLVMSetDisasmOptions.argtypes = [Disassembler, c_uint64] + library.LLVMSetDisasmOptions.restype = c_int + + callbacks['op_info'] = CFUNCTYPE(c_int, c_void_p, c_uint64, c_uint64, c_uint64, c_int, c_void_p) callbacks['symbol_lookup'] = CFUNCTYPE(c_char_p, c_void_p, c_uint64, -- cgit v1.2.3