[all-commits] [llvm/llvm-project] 1b099c: [Examples] Add in_call_stack breakpoint function.

Jonas Devlieghere via All-commits all-commits at lists.llvm.org
Fri Nov 22 15:36:53 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 1b099c1df00e3c8a0ba20af199c89a154bdb7a45
      https://github.com/llvm/llvm-project/commit/1b099c1df00e3c8a0ba20af199c89a154bdb7a45
  Author: Jonas Devlieghere <jonas at devlieghere.com>
  Date:   2019-11-22 (Fri, 22 Nov 2019)

  Changed paths:
    A lldb/examples/python/in_call_stack.py

  Log Message:
  -----------
  [Examples] Add in_call_stack breakpoint function.

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.




More information about the All-commits mailing list