summaryrefslogtreecommitdiffstats
path: root/lldb/test/lldbutil.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test/lldbutil.py')
-rw-r--r--lldb/test/lldbutil.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/test/lldbutil.py b/lldb/test/lldbutil.py
index e7a8572bbd5..b2274453e59 100644
--- a/lldb/test/lldbutil.py
+++ b/lldb/test/lldbutil.py
@@ -232,6 +232,20 @@ def ValueTypeString(enum):
# 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.
OpenPOWER on IntegriCloud