diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2015-07-03 11:17:07 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2015-07-03 11:17:07 +0000 |
| commit | cec93c355a7b2f1a6be436f233b043bd2632d4bd (patch) | |
| tree | 585ea54b3852b5b2473a99191fc049e5ce0073bf | |
| parent | 5a3de1d0e1aafca41726214841f84a03c920d3b7 (diff) | |
| download | bcm5719-llvm-cec93c355a7b2f1a6be436f233b043bd2632d4bd.tar.gz bcm5719-llvm-cec93c355a7b2f1a6be436f233b043bd2632d4bd.zip | |
Fix 128bit register read and user register count on aarch64
llvm-svn: 241340
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp | 26 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h | 3 |
2 files changed, 13 insertions, 16 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp index a8f7304b765..308ffe30505 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp @@ -193,6 +193,15 @@ NativeRegisterContextLinux_arm64::GetRegisterSet (uint32_t set_index) const return nullptr; } +uint32_t +NativeRegisterContextLinux_arm64::GetUserRegisterCount() const +{ + uint32_t count = 0; + for (uint32_t set_index = 0; set_index < k_num_register_sets; ++set_index) + count += g_reg_sets_arm64[set_index].num_registers; + return count; +} + Error NativeRegisterContextLinux_arm64::ReadRegister (const RegisterInfo *reg_info, RegisterValue ®_value) { @@ -242,22 +251,7 @@ NativeRegisterContextLinux_arm64::ReadRegister (const RegisterInfo *reg_info, Re // Get pointer to m_fpr variable and set the data from it. assert (reg_info->byte_offset < sizeof m_fpr); uint8_t *src = (uint8_t *)&m_fpr + reg_info->byte_offset; - switch (reg_info->byte_size) - { - case 2: - reg_value.SetUInt16(*(uint16_t *)src); - break; - case 4: - reg_value.SetUInt32(*(uint32_t *)src); - break; - case 8: - reg_value.SetUInt64(*(uint64_t *)src); - break; - default: - assert(false && "Unhandled data size."); - error.SetErrorStringWithFormat ("unhandled byte size: %" PRIu32, reg_info->byte_size); - break; - } + reg_value.SetFromMemoryData(reg_info, src, reg_info->byte_size, eByteOrderLittle, error); return error; } diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h index de3c08abef9..5de35f8fa57 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h @@ -30,6 +30,9 @@ namespace process_linux { uint32_t GetRegisterSetCount () const override; + uint32_t + GetUserRegisterCount() const override; + const RegisterSet * GetRegisterSet (uint32_t set_index) const override; |

