def inferior_crashing_step(self): """Test that lldb functions correctly after stepping through a crash.""" exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) self.set_breakpoint(self.line) self.runCmd("run", RUN_SUCCEEDED) self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT, substrs = ['main.c:%d' % self.line, 'stop reason = breakpoint']) self.runCmd("next") stop_reason = self.check_stop_reason() # The lldb expression interpreter should be able to read from addresses of the inferior after a crash. self.expect("p argv[0]", substrs = ['a.out']) self.expect("p null_ptr", substrs = ['= 0x0']) # lldb should be able to read from registers from the inferior after crashing. lldbplatformutil.check_first_register_readable(self) # And it should report the correct line number. self.expect("thread backtrace all", substrs = [stop_reason, 'main.c:%d' % self.line])
def inferior_crashing_step(self): """Test that lldb functions correctly after stepping through a crash.""" exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) self.set_breakpoint(self.line) self.runCmd("run", RUN_SUCCEEDED) self.expect( "thread list", STOPPED_DUE_TO_BREAKPOINT, substrs=['main.c:%d' % self.line, 'stop reason = breakpoint']) self.runCmd("next") self.check_stop_reason() # The lldb expression interpreter should be able to read from addresses of the inferior after a crash. self.expect("p argv[0]", substrs=['a.out']) self.expect("p null_ptr", substrs=['= 0x0']) # lldb should be able to read from registers from the inferior after crashing. lldbplatformutil.check_first_register_readable(self) # And it should report the correct line number. self.expect("thread backtrace all", substrs=['main.c:%d' % self.line])
def inferior_crashing_registers(self): """Test that lldb can read registers after crashing.""" exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) self.runCmd("run", RUN_SUCCEEDED) self.check_stop_reason() # lldb should be able to read from registers from the inferior after crashing. lldbplatformutil.check_first_register_readable(self)
def inferior_asserting_registers(self): """Test that lldb can read registers after asserting.""" exe = os.path.join(os.getcwd(), "a.out") self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET) self.runCmd("run", RUN_SUCCEEDED) self.check_stop_reason() # lldb should be able to read from registers from the inferior after asserting. lldbplatformutil.check_first_register_readable(self)