2 Test that commands do not try and hold on to stale CommandInterpreters in a multiple debuggers scenario
6 from lldbsuite
.test
.decorators
import *
7 from lldbsuite
.test
.lldbtest
import *
8 from lldbsuite
.test
import lldbutil
11 class MultipleDebuggersCommandsTestCase(TestBase
):
13 def test_multipledebuggers_commands(self
):
14 """Test that commands do not try and hold on to stale CommandInterpreters in a multiple debuggers scenario"""
15 source_init_files
= False
16 magic_text
= "The following commands may relate to 'env'"
18 debugger_1
= lldb
.SBDebugger
.Create(source_init_files
)
19 interpreter_1
= debugger_1
.GetCommandInterpreter()
21 retobj
= lldb
.SBCommandReturnObject()
22 interpreter_1
.HandleCommand("apropos env", retobj
)
26 "[interpreter_1]: the output does not contain the correct words",
32 lldb
.SBDebugger
.Destroy(debugger_1
)
34 # now do this again with a different debugger - we shouldn't crash
36 debugger_2
= lldb
.SBDebugger
.Create(source_init_files
)
37 interpreter_2
= debugger_2
.GetCommandInterpreter()
39 retobj
= lldb
.SBCommandReturnObject()
40 interpreter_2
.HandleCommand("apropos env", retobj
)
44 "[interpreter_2]: the output does not contain the correct words",
50 lldb
.SBDebugger
.Destroy(debugger_2
)