2 Test that we properly display the backtrace when a noreturn function happens to
3 be at the end of the stack.
9 from lldbsuite.test.decorators import *
10 from lldbsuite.test.lldbtest import *
11 from lldbsuite.test import lldbutil
14 class TestNoreturnModuleEnd(TestBase):
15 NO_DEBUG_INFO_TESTCASE = True
16 mydir = TestBase.compute_mydir(__file__)
19 super(TestNoreturnModuleEnd, self).setUp()
20 self._initial_platform = lldb.DBG.GetSelectedPlatform()
23 lldb.DBG.SetSelectedPlatform(self._initial_platform)
24 super(TestNoreturnModuleEnd, self).tearDown()
27 target = self.dbg.CreateTarget("test.out")
28 process = target.LoadCore("test.core")
29 self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
30 self.assertEqual(process.GetNumThreads(), 1)
32 thread = process.GetSelectedThread()
33 self.assertTrue(thread.IsValid())
40 self.assertEqual(thread.GetNumFrames(), len(backtrace))
41 for i in range(len(backtrace)):
42 frame = thread.GetFrameAtIndex(i)
43 self.assertTrue(frame.IsValid())
44 symbol = frame.GetSymbol()
45 self.assertTrue(symbol.IsValid())
46 self.assertEqual(symbol.GetName(), backtrace[i][0])
47 function_start = symbol.GetStartAddress().GetLoadAddress(target)
48 self.assertEquals(function_start + backtrace[i][1], frame.GetPC())
50 self.dbg.DeleteTarget(target)