Index: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp =================================================================== --- lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -4257,7 +4257,8 @@ reg_info.name.SetString(value); } else if (name == "bitsize") { if (llvm::to_integer(value, reg_info.byte_size)) - reg_info.byte_size /= CHAR_BIT; + reg_info.byte_size = + (reg_info.byte_size + CHAR_BIT - 1) / CHAR_BIT; } else if (name == "type") { gdb_type = value.str(); } else if (name == "group") { Index: lldb/test/API/functionalities/gdb_remote_client/TestArmRegisterDefinition.py =================================================================== --- lldb/test/API/functionalities/gdb_remote_client/TestArmRegisterDefinition.py +++ lldb/test/API/functionalities/gdb_remote_client/TestArmRegisterDefinition.py @@ -38,6 +38,10 @@ + + + + @@ -87,7 +91,7 @@ return "E01" def readRegisters(self): - return "20000000f8360020001000002fcb0008f8360020a0360020200c0020000000000000000000000000000000000000000000000000b87f0120b7d100082ed2000800000001b87f01200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + return "20000000f8360020001000002fcb0008f8360020a0360020200c0020000000000000000000000000000000000000000000000000b87f0120b7d100082ed20008addebeafbc00000001b87f01200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" def haltReason(self): return "S05" @@ -129,3 +133,15 @@ pc_valobj = process.GetThreadAtIndex(0).GetFrameAtIndex(0).FindRegister("pc") self.assertEqual(pc_valobj.GetValueAsUnsigned(), 0x0800d22e) + + sys_valobj = process.GetThreadAtIndex(0).GetFrameAtIndex(0).FindRegister("SYS0") + self.assertEqual(sys_valobj.GetValueAsUnsigned(), 0xdead) + + sys_valobj = process.GetThreadAtIndex(0).GetFrameAtIndex(0).FindRegister("SYS1") + self.assertEqual(sys_valobj.GetValueAsUnsigned(), 0xbe) + + sys_valobj = process.GetThreadAtIndex(0).GetFrameAtIndex(0).FindRegister("SYS2") + self.assertEqual(sys_valobj.GetValueAsUnsigned(), 0xaf) + + sys_valobj = process.GetThreadAtIndex(0).GetFrameAtIndex(0).FindRegister("SYS3") + self.assertEqual(sys_valobj.GetValueAsUnsigned(), 0xbc)