@@ -17,6 +17,7 @@ def lldbcommands():
17
17
FBFindInstancesCommand (),
18
18
FBMethodBreakpointEnableCommand (),
19
19
FBMethodBreakpointDisableCommand (),
20
+ FBSequenceCommand (),
20
21
]
21
22
22
23
class FBWatchInstanceVariableCommand (fb .FBCommand ):
@@ -377,3 +378,23 @@ def chiselLibraryPath(self):
377
378
source_dir = os .path .dirname (source_path )
378
379
# ugh: ../.. is to back out of commands/, then back out of libexec/
379
380
return os .path .join (source_dir , '..' , '..' , 'lib' , 'Chisel.framework' , 'Chisel' )
381
+
382
+
383
+ class FBSequenceCommand (fb .FBCommand ):
384
+ def name (self ):
385
+ return 'sequence'
386
+
387
+ def description (self ):
388
+ return 'Run commands in sequence, stopping on any error.'
389
+
390
+ def lex (self , commandLine ):
391
+ return commandLine .split (';' )
392
+
393
+ def run (self , arguments , options ):
394
+ interpreter = lldb .debugger .GetCommandInterpreter ()
395
+ # The full unsplit command is in position 0.
396
+ sequence = arguments [1 :]
397
+ for command in sequence :
398
+ interpreter .HandleCommand (command .strip (), self .context , self .result )
399
+ if not self .result .Succeeded ():
400
+ break
0 commit comments