Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 21 additions & 0 deletions commands/FBDebugCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def lldbcommands():
FBFindInstancesCommand(),
FBMethodBreakpointEnableCommand(),
FBMethodBreakpointDisableCommand(),
FBSequenceCommand(),
]

class FBWatchInstanceVariableCommand(fb.FBCommand):
Expand Down Expand Up @@ -377,3 +378,23 @@ def chiselLibraryPath(self):
source_dir = os.path.dirname(source_path)
# ugh: ../.. is to back out of commands/, then back out of libexec/
return os.path.join(source_dir, '..', '..', 'lib', 'Chisel.framework', 'Chisel')


class FBSequenceCommand(fb.FBCommand):
def name(self):
return 'sequence'

def description(self):
return 'Run commands in sequence, stopping on any error.'

def lex(self, commandLine):
return commandLine.split(';')

def run(self, arguments, options):
interpreter = lldb.debugger.GetCommandInterpreter()
# The full unsplit command is in position 0.
sequence = arguments[1:]
for command in sequence:
interpreter.HandleCommand(command.strip(), self.context, self.result)
if not self.result.Succeeded():
break
4 changes: 3 additions & 1 deletion fblldb.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ def loadCommand(module, command, directory, filename, extension):
name=name))

def makeRunCommand(command, filename):
def runCommand(debugger, input, result, dict):
def runCommand(debugger, input, exe_ctx, result, _):
command.result = result
command.context = exe_ctx
splitInput = command.lex(input)

# OptionParser will throw in the case where you want just one big long argument and no
Expand Down