Index: test/functionalities/inferior-assert/TestInferiorAssert.py =================================================================== --- test/functionalities/inferior-assert/TestInferiorAssert.py +++ test/functionalities/inferior-assert/TestInferiorAssert.py @@ -95,6 +95,15 @@ return stop_reason + def check_register_read_working(self): + if self.getArchitecture() in ['x86_64', 'i386']: + self.expect("register read eax", substrs = ['eax = 0x']) + elif self.getArchitecture() in ['aarch64']: + self.expect("register read x0", substrs = ['x0 = 0x']) + else: + # TODO: Add check for other architectures + self.fail("Unsupported architecture for test case") + def setUp(self): # Call super's setUp(). TestBase.setUp(self) @@ -150,8 +159,7 @@ self.check_stop_reason() # lldb should be able to read from registers from the inferior after asserting. - self.expect("register read eax", - substrs = ['eax = 0x']) + self.check_register_read_working() def inferior_asserting_disassemble(self): """Test that lldb can disassemble frames after asserting.""" Index: test/functionalities/inferior-crashing/TestInferiorCrashing.py =================================================================== --- test/functionalities/inferior-crashing/TestInferiorCrashing.py +++ test/functionalities/inferior-crashing/TestInferiorCrashing.py @@ -101,6 +101,15 @@ return stop_reason + def check_register_read_working(self): + if self.getArchitecture() in ['x86_64', 'i386']: + self.expect("register read eax", substrs = ['eax = 0x']) + elif self.getArchitecture() in ['aarch64']: + self.expect("register read x0", substrs = ['x0 = 0x']) + else: + # TODO: Add check for other architectures + self.fail("Unsupported architecture for test case") + def get_api_stop_reason(self): return lldb.eStopReasonException @@ -155,8 +164,7 @@ self.check_stop_reason() # lldb should be able to read from registers from the inferior after crashing. - self.expect("register read eax", - substrs = ['eax = 0x']) + self.check_register_read_working() def inferior_crashing_expr(self): """Test that the lldb expression interpreter can read symbols after crashing.""" @@ -195,8 +203,7 @@ substrs = ['= 0x0']) # lldb should be able to read from registers from the inferior after crashing. - self.expect("register read eax", - substrs = ['eax = 0x']) + self.check_register_read_working() # And it should report the correct line number. self.expect("thread backtrace all", Index: test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py =================================================================== --- test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py +++ test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py @@ -102,6 +102,15 @@ return stop_reason + def check_register_read_working(self): + if self.getArchitecture() in ['x86_64', 'i386']: + self.expect("register read eax", substrs = ['eax = 0x']) + elif self.getArchitecture() in ['aarch64']: + self.expect("register read x0", substrs = ['x0 = 0x']) + else: + # TODO: Add check for other architectures + self.fail("Unsupported architecture for test case") + def setUp(self): # Call super's setUp(). TestBase.setUp(self) @@ -157,8 +166,7 @@ self.check_stop_reason() # lldb should be able to read from registers from the inferior after crashing. - self.expect("register read eax", - substrs = ['eax = 0x']) + self.check_register_read_working() def recursive_inferior_crashing_expr(self): """Test that the lldb expression interpreter can read symbols after crashing.""" @@ -192,8 +200,7 @@ substrs = ['(int) $0 =']) # lldb should be able to read from registers from the inferior after crashing. - self.expect("register read eax", - substrs = ['eax = 0x']) + self.check_register_read_working() # And it should report the correct line number. self.expect("thread backtrace all",