diff options
| -rw-r--r-- | lldb/source/Core/RegisterValue.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lldb/source/Core/RegisterValue.cpp b/lldb/source/Core/RegisterValue.cpp index a19b0f30c12..509919dad2c 100644 --- a/lldb/source/Core/RegisterValue.cpp +++ b/lldb/source/Core/RegisterValue.cpp @@ -633,8 +633,11 @@ uint64_t RegisterValue::GetAsUInt64(uint64_t fail_value, default: break; case 1: + return *(const uint8_t *)buffer.bytes; case 2: + return *(const uint16_t *)buffer.bytes; case 4: + return *(const uint32_t *)buffer.bytes; case 8: return *(const uint64_t *)buffer.bytes; } diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp index a59a288c934..580d2f952ad 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp @@ -169,7 +169,7 @@ Error NativeRegisterContextLinux::DoReadRegisterValue(uint32_t offset, if (error.Success()) // First cast to an unsigned of the same size to avoid sign extension. - value.SetUInt64(static_cast<unsigned long>(data)); + value.SetUInt(static_cast<unsigned long>(data), size); if (log) log->Printf("NativeRegisterContextLinux::%s() reg %s: 0x%lx", __FUNCTION__, |

