6dbb3e30ee728cfa78fac85e382a5a033349d71c
[openbsd] /
1 """
2 Test that the target.process.thread.max-backtrace-depth setting works.
3 """
4
5 import unittest2
6 import lldb
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
10
11
12 class BacktraceLimitSettingTest(TestBase):
13
14     mydir = TestBase.compute_mydir(__file__)
15     NO_DEBUG_INFO_TESTCASE = True
16
17     def test_backtrace_depth(self):
18         """Test that the max-backtrace-depth setting limits backtraces."""
19         self.build()
20         self.main_source_file = lldb.SBFileSpec("main.cpp")
21         (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
22                 "Set a breakpoint here", self.main_source_file)
23         interp = self.dbg.GetCommandInterpreter()
24         result = lldb.SBCommandReturnObject()
25         interp.HandleCommand("settings set target.process.thread.max-backtrace-depth 30", result)
26         self.assertEqual(True, result.Succeeded())
27         self.assertEqual(30, thread.GetNumFrames())