Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion fblldb.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def loadCommandsInDirectory(commandsDirectory):
def loadCommand(module, command, directory, filename, extension):
func = makeRunCommand(command, os.path.join(directory, filename + extension))
name = command.name()
helpText = command.description().splitlines()[0] # first line of description

key = filename + '_' + name

Expand All @@ -49,7 +50,10 @@ def loadCommand(module, command, directory, filename, extension):
functionName = '__' + key

lldb.debugger.HandleCommand('script ' + functionName + ' = sys.modules[\'' + module.__name__ + '\']._loadedFunctions[\'' + key + '\']')
lldb.debugger.HandleCommand('command script add -f ' + functionName + ' ' + name)
lldb.debugger.HandleCommand('command script add --help "{help}" --function {function} {name}'.format(
help=helpText.replace('"', '\\"'), # escape quotes
function=functionName,
name=name))

def makeRunCommand(command, filename):
def runCommand(debugger, input, result, dict):
Expand Down