================
@@ -392,32 +393,92 @@ Status
NativeProcessWindows::RemoveBreakpoint(lldb::addr_t addr,
return RemoveSoftwareBreakpoint(addr);
}
+// Resolve the fully qualified, normalized on disk path of a module loaded in
+// the target process.
+static bool GetLoadedModulePath(HANDLE process, HMODULE module,
+ std::string &path) {
+ std::vector<wchar_t> name(MAX_PATH);
+ DWORD len = 0;
+ while (true) {
+ len = ::GetModuleFileNameExW(process, module, name.data(),
+ static_cast<DWORD>(name.size()));
+ if (len == 0)
+ return false;
+ if (len < name.size())
+ break;
+ if (name.size() >= PATHCCH_MAX_CCH)
+ return false;
+ name.resize(name.size() * 2);
+ }
+
+ std::wstring wpath(name.data(), len);
+
+ // Canonicalize through a handle to the image file so the reported path
+ // matches the on-disk name exactly.
+ AutoHandle file(::CreateFileW(
+ wpath.c_str(), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr));
+
+ if (!file.IsValid())
+ return llvm::convertWideToUTF8(wpath, path);
+
+ std::vector<wchar_t> full(MAX_PATH);
----------------
charles-zablit wrote:
Fixed 👍
https://github.com/llvm/llvm-project/pull/206117
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits