Revert "[LoongArch] Eliminate the redundant sign extension of division (#107971)"
[llvm-project.git] / lldb / test / API / functionalities / multidebugger_commands / TestMultipleDebuggersCommands.py
blob98d7e8e9212fab34a68035a852975e673b6eff9e
1 """
2 Test that commands do not try and hold on to stale CommandInterpreters in a multiple debuggers scenario
3 """
5 import lldb
6 from lldbsuite.test.decorators import *
7 from lldbsuite.test.lldbtest import *
8 from lldbsuite.test import lldbutil
11 class MultipleDebuggersCommandsTestCase(TestBase):
12 @no_debug_info_test
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)
23 self.assertIn(
24 magic_text,
25 str(retobj),
26 "[interpreter_1]: the output does not contain the correct words",
29 if self.TraceOn():
30 print(str(retobj))
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)
41 self.assertIn(
42 magic_text,
43 str(retobj),
44 "[interpreter_2]: the output does not contain the correct words",
47 if self.TraceOn():
48 print(str(retobj))
50 lldb.SBDebugger.Destroy(debugger_2)