[Lldb-commits] [PATCH] D137860: [lldb] Allow flexible importing of in_call_stack

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Nov 11 12:20:10 PST 2022


kastiglione created this revision.
kastiglione added a reviewer: jingham.
Herald added a project: All.
kastiglione requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137860

Files:
  lldb/examples/python/in_call_stack.py


Index: lldb/examples/python/in_call_stack.py
===================================================================
--- lldb/examples/python/in_call_stack.py
+++ lldb/examples/python/in_call_stack.py
@@ -3,7 +3,7 @@
 
 def __lldb_init_module(debugger, internal_dict):
   debugger.HandleCommand(
-      'command alias in_call_stack breakpoint command add --python-function in_call_stack.in_call_stack -k name -v %1'
+      f'command alias in_call_stack breakpoint command add --python-function {__name__}.in_call_stack -k name -v %1'
   )
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137860.474834.patch
Type: text/x-patch
Size: 539 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221111/2fc7100c/attachment.bin>


More information about the lldb-commits mailing list