Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / API / api / multithreaded / some_cmd.py
blob1eeb7511695e0de202743e7369c5da345311e225
1 """ Test command for checking the Python commands can run in a stop-hook """
2 import lldb
4 did_run = False
7 class SomeCommand:
8 def __init__(self, debugger, unused):
9 self.dbg = debugger
11 def __call__(self, debugger, command, exe_ctx, result):
12 global did_run
13 did_run = True
14 result.PutCString("some output\n")
16 def get_short_help(self):
17 return "Test command - sets a variable."
20 class OtherCommand:
21 def __init__(self, debugger, unused):
22 self.dbg = debugger
24 def __call__(self, debugger, command, exe_ctx, result):
25 global did_run
26 if did_run:
27 result.SetStatus(lldb.eReturnStatusSuccessFinishNoResult)
28 else:
29 result.SetStatus(lldb.eReturnStatusFailed)
31 def get_short_help(self):
32 return "Test command - sets a variable."
35 def __lldb_init_module(debugger, unused):
36 print("Adding command some-cmd and report-cmd")
37 debugger.HandleCommand("command script add -c some_cmd.SomeCommand some-cmd")
38 debugger.HandleCommand("command script add -c some_cmd.OtherCommand report-cmd")