summaryrefslogtreecommitdiff
path: root/lldb/examples/python/in_call_stack.py
AgeCommit message (Collapse)Author
2023-05-25[NFC][Py Reformat] Reformat python files in lldbJonas Devlieghere
This is an ongoing series of commits that are reformatting our Python code. Reformatting is done with `black` (23.1.0). If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run `git checkout --ours <yourfile>` and then reformat it with black. RFC: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Differential revision: https://reviews.llvm.org/D151460
2022-11-11[lldb] Allow flexible importing of in_call_stackDave Lee
Allow `in_call_stack` to be imported in either of the following ways: ``` command script import path/to/in_call_stack.py command script import lldb.utils.in_call_stack ``` rdar://102249295 Differential Revision: https://reviews.llvm.org/D137860
2019-11-22[Examples] Move structured-data unpacking out of the loop. (NFC)Jonas Devlieghere
There's no need to repeat this work in the loop.
2019-11-22[Examples] Add in_call_stack breakpoint function.Jonas Devlieghere
The in_call_stack Python script makes it possible to modify the last breakpoint to only stop if a given function is present in the call stack. It will check both the symbol name and the function name (coming from the debug info, in case the binary is stripped). To use this, you have to: 1. Import the script into lldb. (lldb) command script import in_call_stack.py 2. Set a breakpoint and use the in_call_stack alias. (lldb) b foo (lldb) in_call_stack bar Note that this alias operates on the last set breakpoint. You can re-run the in_call_stack command to modify the condition.