summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
diff options
context:
space:
mode:
authorStella Stamenova <stilis@microsoft.com>2018-12-01 00:18:19 +0000
committerStella Stamenova <stilis@microsoft.com>2018-12-01 00:18:19 +0000
commit975814a7c710729e0c372343abeb06ab1bd163f1 (patch)
tree1471e4cde685ac2d1663dc6524bfc654bba7ca23 /lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
parent842a512ac8627000b4cd1fa5e6ffa5952c35866b (diff)
downloadbcm5719-llvm-975814a7c710729e0c372343abeb06ab1bd163f1.tar.gz
bcm5719-llvm-975814a7c710729e0c372343abeb06ab1bd163f1.zip
[windows] Fix two minor bugs on Windows
1. In ProcessWindows if we fail to allocate memory, we need to return LLDB_INVALID_ADDRESS rather than 0 or nullptr as that is the invalid address that LLDB looks for 2. In RegisterContextWindows in ReadAllRegisterValues, always create a new buffer. This is what the other platforms do and data_sp is always null in all tested scenarios on Windows as well llvm-svn: 348055
Diffstat (limited to 'lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp')
-rw-r--r--lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
index b6ba70289d9..06ef6b76582 100644
--- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -722,7 +722,7 @@ lldb::addr_t ProcessWindows::DoAllocateMemory(size_t size, uint32_t permissions,
LLDB_LOG(log, "cannot allocate, there is no active debugger connection.");
error.SetErrorString(
"cannot allocate, there is no active debugger connection");
- return 0;
+ return LLDB_INVALID_ADDRESS;
}
HostProcess process = m_session_data->m_debugger->GetProcess();
@@ -732,7 +732,7 @@ lldb::addr_t ProcessWindows::DoAllocateMemory(size_t size, uint32_t permissions,
if (!result) {
error.SetError(GetLastError(), eErrorTypeWin32);
LLDB_LOG(log, "allocating failed with error: {0}", error);
- return 0;
+ return LLDB_INVALID_ADDRESS;
}
return reinterpret_cast<addr_t>(result);
OpenPOWER on IntegriCloud