1""" 2Test that we can backtrace correctly from Non ABI functions on the stack 3""" 4 5 6 7import lldb 8from lldbsuite.test.decorators import * 9from lldbsuite.test.lldbtest import * 10from lldbsuite.test import lldbutil 11 12 13class EHFrameBasedUnwind(TestBase): 14 15 @skipUnlessPlatform(['linux']) 16 @skipIf(archs=["aarch64", "arm", "i386", "i686"]) 17 def test(self): 18 """Test that we can backtrace correctly from Non ABI functions on the stack""" 19 self.build() 20 self.setTearDownCleanup() 21 22 exe = self.getBuildArtifact("a.out") 23 target = self.dbg.CreateTarget(exe) 24 25 self.assertTrue(target, VALID_TARGET) 26 27 lldbutil.run_break_set_by_symbol(self, "func") 28 29 process = target.LaunchSimple( 30 ["abc", "xyz"], None, self.get_process_working_directory()) 31 32 if not process: 33 self.fail("SBTarget.Launch() failed") 34 35 if process.GetState() != lldb.eStateStopped: 36 self.fail("Process should be in the 'stopped' state, " 37 "instead the actual state is: '%s'" % 38 lldbutil.state_type_to_str(process.GetState())) 39 40 stacktraces = lldbutil.print_stacktraces(process, string_buffer=True) 41 self.expect(stacktraces, exe=False, 42 substrs=['(int)argc=3']) 43 44 self.runCmd("thread step-inst") 45 46 stacktraces = lldbutil.print_stacktraces(process, string_buffer=True) 47 self.expect(stacktraces, exe=False, 48 substrs=['(int)argc=3']) 49