add flags, ts_flags properties for Instr class
This commit is contained in:
parent
cadc53f174
commit
3c06f0d590
3 changed files with 13 additions and 2 deletions
|
|
@ -87,6 +87,18 @@ class Instr(object):
|
|||
|
||||
return l
|
||||
|
||||
@property
|
||||
def instr_desc(self):
|
||||
return self.tm.instr_info.get(self.mcinst.getOpcode())
|
||||
|
||||
@property
|
||||
def flags(self):
|
||||
return self.instr_desc.getFlags()
|
||||
|
||||
@property
|
||||
def ts_flags(self):
|
||||
return self.instr_desc.TSFlags
|
||||
|
||||
class BadInstr(Instr):
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ if llvm.version >= (3, 4):
|
|||
else:
|
||||
print("\t0x%x ops = %s" % (addr, ops))
|
||||
|
||||
print("\t\tflags = 0x%x, tsflags = 0x%x" % (inst.flags, inst.ts_flags))
|
||||
for line in str(inst).split("\n"):
|
||||
print("\t%s" % (line))
|
||||
|
||||
|
|
|
|||
|
|
@ -6,14 +6,12 @@ def main():
|
|||
triple = "i386--"
|
||||
|
||||
print("init start")
|
||||
'''
|
||||
api.llvm.InitializeAllTargets()
|
||||
api.llvm.InitializeAllTargetInfos()
|
||||
api.llvm.InitializeAllTargetMCs()
|
||||
api.llvm.InitializeAllAsmParsers()
|
||||
api.llvm.InitializeAllAsmPrinters()
|
||||
api.llvm.InitializeAllDisassemblers()
|
||||
'''
|
||||
print("init done\n")
|
||||
|
||||
tm = llvm.target.TargetMachine.x86()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue