Add test cases for Python SBThread.StepOut() API by stepping out of a malloc call where the call site is at function b().
Verifies that after the thread.StepOut(), we are at the correct line within function b.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@127374 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/lldbutil.py b/test/lldbutil.py
index e7a8572..b227445 100644
--- a/test/lldbutil.py
+++ b/test/lldbutil.py
@@ -232,6 +232,20 @@
# Utility functions related to Threads and Processes
# ==================================================
+def get_caller_symbol(thread):
+ """
+ Returns the symbol name for the call site of the leaf function.
+ """
+ depth = thread.GetNumFrames()
+ if depth <= 1:
+ return None
+ caller = thread.GetFrameAtIndex(1).GetSymbol()
+ if caller:
+ return caller.GetName()
+ else:
+ return None
+
+
def GetFunctionNames(thread):
"""
Returns a sequence of function names from the stack frames of this thread.