summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/windows/Host.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-05-22 19:34:17 +0000
committerZachary Turner <zturner@google.com>2015-05-22 19:34:17 +0000
commit279a2b75758f4c3c09652d3720c63e8549ce6a00 (patch)
treeff46bcb60113289874caf639b13b113e943c79c6 /lldb/source/Host/windows/Host.cpp
parent4f2a9726d4d1ed9f513926dc340b722978674e7b (diff)
downloadbcm5719-llvm-279a2b75758f4c3c09652d3720c63e8549ce6a00.tar.gz
bcm5719-llvm-279a2b75758f4c3c09652d3720c63e8549ce6a00.zip
Implement PlatformWindows::GetEnvironment.
This fixes a couple of tests that rely on being able to get the host's environment or spawn an inferior with specific arguments. llvm-svn: 238042
Diffstat (limited to 'lldb/source/Host/windows/Host.cpp')
-rw-r--r--lldb/source/Host/windows/Host.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/Host/windows/Host.cpp b/lldb/source/Host/windows/Host.cpp
index 38dc252bba6..4a1c34f5c11 100644
--- a/lldb/source/Host/windows/Host.cpp
+++ b/lldb/source/Host/windows/Host.cpp
@@ -306,3 +306,21 @@ Host::ShellExpandArguments (ProcessLaunchInfo &launch_info)
return error;
}
+
+size_t
+Host::GetEnvironment(StringList &env)
+{
+ // The environment block on Windows is a contiguous buffer of NULL terminated strings,
+ // where the end of the environment block is indicated by two consecutive NULLs.
+ LPCH environment_block = ::GetEnvironmentStrings();
+ env.Clear();
+ while (*environment_block != '\0')
+ {
+ llvm::StringRef current_var(environment_block);
+ if (current_var[0] != '=')
+ env.AppendString(current_var);
+
+ environment_block += current_var.size()+1;
+ }
+ return env.GetSize();
+}
OpenPOWER on IntegriCloud