in fblldb.py [0:0]
def loadCommand(module, command, directory, filename, extension):
func = makeRunCommand(command, os.path.join(directory, filename + extension))
name = command.name()
helpText = (
command.description().strip().splitlines()[0]
) # first line of description
key = filename + "_" + name
module._loadedFunctions[key] = func
functionName = "__" + key
lldb.debugger.HandleCommand(
"script "
+ functionName
+ " = sys.modules['"
+ module.__name__
+ "']._loadedFunctions['"
+ key
+ "']"
)
lldb.debugger.HandleCommand(
'command script add --help "{help}" --function {function} {name}'.format(
help=helpText.replace('"', '\\"'), # escape quotes
function=functionName,
name=name,
)
)