summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Schuetze <r.sagitario@gmx.de>2020-03-09 07:04:29 (GMT)
committerRainer Schuetze <r.sagitario@gmx.de>2020-03-09 07:04:29 (GMT)
commit191f0a0b1131e5d095637a9381787f7779766ec5 (patch)
tree4e9018e0f0dac786f0cc6cc4a14ecc3b9e4a95c6
parentd331d1f1a15e28a1ca9b0747cfe7e9f363eab878 (diff)
downloadcv2pdb-191f0a0b1131e5d095637a9381787f7779766ec5.zip
cv2pdb-191f0a0b1131e5d095637a9381787f7779766ec5.tar.gz
cv2pdb-191f0a0b1131e5d095637a9381787f7779766ec5.tar.bz2
fix loading 64-bit mspdb140.dll in VS2019
-rw-r--r--CHANGES5
-rw-r--r--src/mspdb.cpp22
2 files changed, 26 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 7cc3e4b..25f4a3e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -288,8 +288,11 @@ unreleased Version 0.22
* emit "elemtype[keytype]" instead of "dAssocArray"
* DWARF: fixed converting unnamed structs/unions as part of other structs
-unreleased Version 0.46
+2019-09-03 Version 0.46
* DWARF: fix writing info for aggregates larger than 32kB
+2019-11-02 Version 0.47
+ * add support for char16_t and char32_t (emitted by dmd 2.089+ for dchar)
+ * fix loading 64-bit mspdb140.dll in VS2019
diff --git a/src/mspdb.cpp b/src/mspdb.cpp
index 00684ed..4267ac8 100644
--- a/src/mspdb.cpp
+++ b/src/mspdb.cpp
@@ -113,9 +113,31 @@ bool tryLoadMsPdbCom(const char* mspdb, const char* path = 0)
WideCharToMultiByte(CP_ACP, 0, installDir, -1, modpath, 260, NULL, NULL);
SysFreeString(installDir);
+#ifdef _WIN64
+ strncat(modpath, "\\VC\\Tools\\MSVC\\*", 260);
+ WIN32_FIND_DATAA data;
+ HANDLE hFind = FindFirstFileA(modpath, &data); // DIRECTORY
+
+ if (hFind != INVALID_HANDLE_VALUE)
+ {
+ int len = strlen(modpath) - 1;
+ do
+ {
+ modpath[len] = 0;
+ strncat(modpath, data.cFileName, 260);
+ strncat(modpath, "\\bin\\Hostx64\\x64\\", 260);
+ strncat(modpath, mspdb, 260);
+ tryLoadLibrary(modpath);
+ }
+ while (!modMsPdb && FindNextFileA(hFind, &data));
+ FindClose(hFind);
+ }
+
+#else
strncat(modpath, "\\Common7\\IDE\\", 260); // wrong path for x64 build of cv2pdb
strncat(modpath, mspdb, 260);
tryLoadLibrary(modpath);
+#endif
}
return true;