Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup: fix windows compiler error
Use WCHAR for module names
  • Loading branch information
gireeshpunathil committed Dec 11, 2018
commit d97d06aa617617c7109454b568daa8462adcc99f
15 changes: 10 additions & 5 deletions src/debug_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,16 @@ std::vector<std::string> NativeSymbolDebuggingContext::GetLoadedLibraries() {
i++) {
WCHAR module_name[MAX_PATH];
// Obtain and report the full pathname for each module
if (GetModuleFileNameEx(process_handle,
modules.data[i],
module_name,
arraysize(module_name) / sizeof(WCHAR))) {
list.push_back(module_name);
if (GetModuleFileNameExW(process_handle,
modules.data[i],
module_name,
arraysize(module_name) / sizeof(WCHAR))) {
DWORD size = WideCharToMultiByte(
CP_UTF8, 0, module_name, -1, nullptr, 0, nullptr, nullptr);
char* str = new char[size];
WideCharToMultiByte(
CP_UTF8, 0, module_name, -1, str, size, nullptr, nullptr);
list.push_back(str);
}
}
}
Expand Down