summaryrefslogtreecommitdiff
path: root/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp')
-rw-r--r--source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp b/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
index b3f507128f82..90d43b2cf828 100644
--- a/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
+++ b/source/Plugins/Process/Windows/Common/RegisterContextWindows.cpp
@@ -40,12 +40,13 @@ void RegisterContextWindows::InvalidateAllRegisters() {
bool RegisterContextWindows::ReadAllRegisterValues(
lldb::DataBufferSP &data_sp) {
+
if (!CacheAllRegisterValues())
return false;
- if (data_sp->GetByteSize() < sizeof(m_context)) {
- data_sp.reset(new DataBufferHeap(sizeof(CONTEXT), 0));
- }
+
+ data_sp.reset(new DataBufferHeap(sizeof(CONTEXT), 0));
memcpy(data_sp->GetBytes(), &m_context, sizeof(m_context));
+
return true;
}