
Make it possible to use a relative path in command script import to the location of the file being sourced. This allows the user to put Python scripts next to LLDB command files and importing them without having to specify an absolute path. To enable this behavior pass `-c` to `command script import`. The argument can only be used when sourcing the command from a file. rdar://68310384 Differential revision: https://reviews.llvm.org/D89334
21 lines
550 B
Plaintext
21 lines
550 B
Plaintext
#--- magritte.in
|
|
command script import magritte
|
|
#--- magritte.py
|
|
import lldb
|
|
|
|
def magritte(debugger, command, result, internal_dict):
|
|
print("Ceci n'est pas une pipe")
|
|
|
|
def __lldb_init_module(debugger, internal_dict):
|
|
debugger.HandleCommand('command script add -f magritte.magritte magritte')
|
|
#--- zip.in
|
|
command script import -c zip
|
|
#--- zip.py
|
|
import lldb
|
|
|
|
def zip(debugger, command, result, internal_dict):
|
|
print("95126")
|
|
|
|
def __lldb_init_module(debugger, internal_dict):
|
|
debugger.HandleCommand('command script add -f zip.zip zip')
|