brintos

brintos / llvm-project-archived public Read only

0
0
Text · 942 B · fded504 Raw
28 lines · python
1"""2Test that the target.process.thread.max-backtrace-depth setting works.3"""4 5import lldb6from lldbsuite.test.decorators import *7from lldbsuite.test.lldbtest import *8from lldbsuite.test import lldbutil9 10 11class BacktraceLimitSettingTest(TestBase):12    NO_DEBUG_INFO_TESTCASE = True13 14    def test_backtrace_depth(self):15        """Test that the max-backtrace-depth setting limits backtraces."""16        self.build()17        self.main_source_file = lldb.SBFileSpec("main.cpp")18        (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(19            self, "Set a breakpoint here", self.main_source_file20        )21        interp = self.dbg.GetCommandInterpreter()22        result = lldb.SBCommandReturnObject()23        interp.HandleCommand(24            "settings set target.process.thread.max-backtrace-depth 30", result25        )26        self.assertTrue(result.Succeeded())27        self.assertEqual(30, thread.GetNumFrames())28