Added GetStackFrames(thread) utility function.

llvm-svn: 113460
This commit is contained in:
Johnny Chen 2010-09-09 00:55:07 +00:00
parent 24dc27f73a
commit 43a651c609
1 changed files with 10 additions and 0 deletions

View File

@ -44,6 +44,16 @@ def GetModuleNames(thread):
return map(GetModuleName, range(thread.GetNumFrames()))
def GetStackFrames(thread):
"""
Returns a sequence of stack frames for this thread.
"""
def GetStackFrame(i):
return thread.GetFrameAtIndex(i)
return map(GetStackFrame, range(thread.GetNumFrames()))
def PrintStackTrace(thread):
"""Prints a simple stack trace of this thread."""
depth = thread.GetNumFrames()