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'
   )
 
 


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'
   )
 
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to