[Lldb-commits] [lldb] [lldb][windows] allow longer paths than MAX_PATH in GetFileNameByLoadAddress (PR #200225)

via lldb-commits lldb-commits at lists.llvm.org
Thu May 28 11:49:11 PDT 2026


================
@@ -555,11 +556,14 @@ static std::optional<std::string> GetFileNameByLoadAddress(HANDLE hProcess,
   }
 
   // Fallback: ask the kernel for the file backing the mapping at this address.
-  std::array<wchar_t, MAX_PATH + 1> mapped_filename;
-  if (!::GetMappedFileNameW(hProcess, base_addr, mapped_filename.data(),
-                            mapped_filename.size()))
+  std::vector<wchar_t> mapped_filename(PATHCCH_MAX_CCH);
----------------
Nerixyz wrote:

30 KiB sounds a bit much for most files. Could we try to use `MAX_PATH` and only expand if we get `ERROR_INSUFFICIENT_BUFFER`?

https://github.com/llvm/llvm-project/pull/200225


More information about the lldb-commits mailing list