summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp')
-rw-r--r--lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp b/lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp
index 9516040edc6..04cad37c263 100644
--- a/lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp
+++ b/lldb/source/Plugins/Process/Windows/Live/ProcessWindowsLive.cpp
@@ -47,6 +47,7 @@
#include "ProcessWindowsLive.h"
#include "TargetThreadWindowsLive.h"
+#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/raw_ostream.h"
@@ -61,17 +62,19 @@ namespace
std::string
GetProcessExecutableName(HANDLE process_handle)
{
- std::vector<char> file_name;
+ std::vector<wchar_t> file_name;
DWORD file_name_size = MAX_PATH; // first guess, not an absolute limit
DWORD copied = 0;
do
{
file_name_size *= 2;
file_name.resize(file_name_size);
- copied = ::GetModuleFileNameEx(process_handle, NULL, file_name.data(), file_name_size);
+ copied = ::GetModuleFileNameExW(process_handle, NULL, file_name.data(), file_name_size);
} while (copied >= file_name_size);
file_name.resize(copied);
- return std::string(file_name.begin(), file_name.end());
+ std::string result;
+ llvm::convertWideToUTF8(file_name.data(), result);
+ return result;
}
std::string
OpenPOWER on IntegriCloud