Files
clang-r547379/lib/python3.11/site-packages/lldb/utils/in_call_stack.py
Ryan Prichard 6024e5c395 Update prebuilt Clang to r547379 (20.0.0).
clang 20.0.0 (based on r547379) from build 12806354.

Bug: http://b/379133546
Test: N/A
Change-Id: I2eb8938af55d809de674be63cb30cf27e801862b

Upstream-Commit: ad834e67b1105d15ef907f6255d4c96e8e733f57
2025-11-26 14:59:46 -05:00

25 lines
797 B
Python

#!/usr/bin/env python
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand(
f"command alias in_call_stack breakpoint command add --python-function {__name__}.in_call_stack -k name -v %1"
)
def in_call_stack(frame, bp_loc, arg_dict, _):
"""Only break if the given name is in the current call stack."""
name = arg_dict.GetValueForKey("name").GetStringValue(1000)
thread = frame.GetThread()
found = False
for frame in thread.frames:
# Check the symbol.
symbol = frame.GetSymbol()
if symbol and name in frame.GetSymbol().GetName():
return True
# Check the function.
function = frame.GetFunction()
if function and name in function.GetName():
return True
return False