Modify disassemble_call_stack_python() to not rely on the "disassemble -n function_name"

command to do the disassembly.  Instead, use the Python API.

llvm-svn: 123029
This commit is contained in:
Johnny Chen 2011-01-07 20:34:32 +00:00
parent 9bf259581c
commit 117ff9005c
1 changed files with 9 additions and 1 deletions

View File

@ -96,7 +96,15 @@ class IterateFrameAndDisassembleTestCase(TestBase):
for i in range(depth - 1):
frame = thread.GetFrameAtIndex(i)
function = frame.GetFunction()
self.runCmd("disassemble -n '%s'" % function.GetName())
# Print the function header.
print
print function
if function.IsValid():
# Get all instructions for this function and print them out.
insts = function.GetInstructions(target)
from lldbutil import lldb_iter
for i in lldb_iter(insts, 'GetSize', 'GetInstructionAtIndex'):
print i
if __name__ == '__main__':