diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
new file mode 100644
index 00000000..06867917
--- /dev/null
+++ b/.github/workflows/build-and-test.yml
@@ -0,0 +1,62 @@
+name: build visuald
+
+on: [push, pull_request]
+
+env:
+ # Path to the solution file relative to the root of the project.
+ SOLUTION_FILE_PATH: src/visuald_vs10.vcxproj
+
+ # Configuration type to build.
+ BUILD_CONFIGURATION: Release
+ BUILD_PLATFORM: x64
+ BUILD_PLATFORM_TOOLSET: v142
+
+jobs:
+ build:
+ # windows-latest doesn't have .net framework 4.0
+ runs-on: windows-2019
+
+ steps:
+ - name: Checkout visuald
+ uses: actions/checkout@v3
+ with:
+ path: visuald/trunk
+ submodules: recursive
+# - name: Checkout cv2pdb
+# uses: actions/checkout@v3
+# with:
+# repository: rainers/cv2pdb
+# path: cv2pdb/trunk
+# - name: Checkout mago
+# uses: actions/checkout@v3
+# with:
+# repository: rainers/mago
+# path: mago
+ - name: Prepare D compiler
+ uses: dlang-community/setup-dlang@v1
+ with:
+ compiler: dmd-2.098.1
+ - name: Add MSBuild to PATH
+ uses: microsoft/setup-msbuild@v1.0.2
+ - name: Setup VS environment
+ uses: seanmiddleditch/gha-setup-vsdevenv@v4
+ - name: Download Visual D
+ uses: supplypike/setup-bin@v1
+ with:
+ uri: 'https://github.com/dlang/visuald/releases/download/v1.3.0/VisualD-v1.3.0.exe'
+ name: 'VisualD-v1.3.0.exe'
+ version: '1.3.0'
+ command: ./VisualD-v1.3.0.exe /S
+ - name: Register visuald
+ run: |
+ reg add "HKLM\SOFTWARE\DMD" /v "InstallationDir" /t REG_SZ /d "c:\hostedtoolcache\windows\dc\dmd-2.098.1\x64" /reg:32 /f
+ reg add "HKLM\SOFTWARE\VisualD" /v "DMDInstallDir" /t REG_SZ /d "c:\hostedtoolcache\windows\dc\dmd-2.098.1\x64\dmd2" /reg:32 /f
+ - name: Build visuald
+ working-directory: visuald/trunk
+ run: nmake d_modules
+ - name: Upload binaries
+ uses: actions/upload-artifact@v2
+ if: failure()
+ with:
+ name: bin
+ path: visuald/trunk/bin
diff --git a/CHANGES b/CHANGES
index bc9a7d80..594ffb28 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1330,7 +1330,15 @@ Version history
* bugzilla 22764: now searches the 32-bit registry hive for install paths of DMD and LDC
* bugzilla 23069: mago crashing when debugging VARIANT data type in VS 2022
* bugzilla 23043: project templates missing in VS 2022 until configuration manually updated
- * semantic analysis: without a project loaded, a D file is now analized using the compile options
+ * semantic analysis: without a project loaded, a D file is now analyzed using the compile options
of "Compile and Run" with an import path derived from the module declaration.
* visualdproj: exit code printed for failed commands
* cv2pdb 0.52: improved DWARF support for non-contiguous functions, bug fixes
+
+2022-10-09 version 1.3.1
+ * full installer now bundled with DMD 2.100.2 and LDC 1.30.0
+ * dmdserver: fixed memory leak
+ * fixed building against WinSDK 10.0.22621.0
+ * fixed projects no longer considered failing
+ * D files in VC projects failed to build in VS 2022 17.3 and 17.4, added separate versions of
+ dbuild.17.x.dll linked respective Microsoft.Build.CPPTasks.Common.dll
diff --git a/Makefile b/Makefile
index a6ac4269..19508668 100644
--- a/Makefile
+++ b/Makefile
@@ -143,6 +143,14 @@ dbuild17_1:
dbuild17_2:
cd msbuild\dbuild && $(MSBUILD) dbuild.csproj /p:Configuration=Release-v17_2;Platform=AnyCPU /t:Rebuild
+dbuild17_3:
+ cd msbuild\dbuild && $(MSBUILD) dbuild.csproj /p:Configuration=Release-v17_3;Platform=AnyCPU /t:Rebuild
+
+dbuild17_4:
+ cd msbuild\dbuild && $(MSBUILD) dbuild.csproj /p:Configuration=Release-v17_4;Platform=AnyCPU /t:Rebuild
+
+dbuild17_all: dbuild17 dbuild17_1 dbuild17_2 dbuild17_3 dbuild17_4
+
mago:
cd ..\..\mago && devenv /Build "Release|Win32" /Project "MagoNatDE" magodbg_2010.sln
cd ..\..\mago && devenv /Build "Release|x64" /Project "MagoRemote" magodbg_2010.sln
@@ -196,7 +204,9 @@ install_vs_no_vs2017: install_modules fake_dparser cv2pdb mago magogc dbuild12
install_vs_only_vs2017: install_modules dparser dparser_test cv2pdb_vs15 mago_vs15 magogc fake_dbuild12 fake_dbuild14 dbuild15 install_only
-install_modules: prerequisites visuald_vs visuald_vs_x64 vdserver dmdserver vdextension vdext15 visualdwizard dcxxfilt
+install_modules: d_modules vdextension vdext15 visualdwizard dcxxfilt
+
+d_modules: prerequisites visuald_vs visuald_vs_x64 vdserver dmdserver
install_only:
if not exist ..\downloads\nul md ..\downloads
diff --git a/VERSION b/VERSION
index 9b3b8cbb..d0bbf450 100644
--- a/VERSION
+++ b/VERSION
@@ -1,5 +1,5 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
-#define VERSION_REVISION 0
+#define VERSION_REVISION 1
#define VERSION_BETA
#define VERSION_BUILD 0
diff --git a/c2d/idl2d.d b/c2d/idl2d.d
index e99b8343..e444476c 100644
--- a/c2d/idl2d.d
+++ b/c2d/idl2d.d
@@ -622,6 +622,22 @@ class idl2d
case "RtlFlushNonVolatileMemoryRanges":
return 1;
+ // SDK 10.0.22621.0
+ case "WIN_NOEXCEPT":
+ case "ReadLongPtrAcquire":
+ case "ReadLongPtrNoFence":
+ case "ReadLongPtrRaw":
+ case "WriteLongPtrRelease":
+ case "WriteLongPtrNoFence":
+ case "WriteLongPtrRaw":
+ case "ReadULongPtrAcquire":
+ case "ReadULongPtrNoFence":
+ case "ReadULongPtrRaw":
+ case "WriteULongPtrRelease":
+ case "WriteULongPtrNoFence":
+ case "WriteULongPtrRaw":
+ return 1;
+
default:
break;
}
@@ -1086,6 +1102,8 @@ version(all)
while(replaceTokenSequence(tokens, "$_not $_ident($_ident1)($expr)", "$_not cast($_ident1)($expr)", true) > 0) {}
replaceTokenSequence(tokens, "$_not $_ident($_ident1)cast", "$_not cast($_ident1)cast", true);
replaceTokenSequence(tokens, "$_not $_ident($_ident1*)$_not_semi;", "$_not cast($_ident1*)$_not_semi", true);
+ replaceTokenSequence(tokens, "$_not $_ident(const $_ident1*)$_not_semi;", "$_not cast(const $_ident1*)$_not_semi", true);
+ replaceTokenSequence(tokens, "$_not $_ident(volatile const $_ident1*)$_not_semi;", "$_not cast(volatile const $_ident1*)$_not_semi", true);
replaceTokenSequence(tokens, "$_not $_ident(struct $_ident1*)$_not_semi;", "$_not cast(struct $_ident1*)$_not_semi", true);
replaceTokenSequence(tokens, "$_not $_ident($_ident1 $_ident2*)", "$_not cast($_ident1 $_ident2*)", true);
replaceTokenSequence(tokens, "HRESULT cast", "HRESULT", true);
@@ -1270,6 +1288,11 @@ version(all)
replaceTokenSequence(tokens, "#ifndef TRUE\n#define TRUE$def\n#endif\n", "#define TRUE 1\n", false);
}
+ if(currentModule == "memoryapi")
+ {
+ replaceTokenSequence(tokens, "typedef struct DECLSPEC_ALIGN($_num)", "align($_num) typedef struct", true);
+ }
+
if(currentModule == "winnt")
{
replaceTokenSequence(tokens, "#if defined(MIDL_PASS)\ntypedef struct $_ident {\n"
@@ -1299,6 +1322,13 @@ version(all)
replaceTokenSequence(tokens, "RtlZeroMemory($dest,$length)",
"import core.stdc.string: memset; memset($dest,0,$length)", true);
+ // win 10.0.22621.0: duplicate definition
+ replaceTokenSequence(tokens, "POWER_SETTING_ALTITUDE, *PPOWER_SETTING_ALTITUDE;",
+ "*PPOWER_SETTING_ALTITUDE;", true);
+ replaceTokenSequence(tokens, "FORCEINLINE BYTE ReadUCharAcquire $code WriteULong64Raw($args) { $code2 }",
+ "/+ $* +/", true);
+ replaceTokenSequence(tokens, "FORCEINLINE PVOID ReadPointerAcquire $code WritePointerRaw($args) { $code2 }",
+ "/+ $* +/", true);
}
if(currentModule == "commctrl")
@@ -1385,7 +1415,10 @@ version(all)
// type name and field name identical
replaceTokenSequence(tokens, "ImageMoniker ImageMoniker;", "ImageMoniker mImageMoniker;", true);
}
-
+ if(currentModule.startsWith("webprop"))
+ {
+ replaceTokenSequence(tokens, "importlib(\"Microsoft.VisualStudio.Interop.tlb\");", "/+ $* +/;", true);
+ }
// select unicode version of the API when defining without postfix A/W
replaceTokenSequence(tokens, "#ifdef UNICODE\nreturn $_identW(\n#else\nreturn $_identA(\n#endif\n",
" return $_identW(", false);
@@ -1573,6 +1606,8 @@ version(all)
enums[tok.text] = true;
break;
}
+ if(indexOf(tok.pretext, "\\\n") >= 0)
+ tok.pretext = replace(tok.pretext, "\\\n", "\n");
prevtext = tok.text;
++tokIt;
}
@@ -1653,6 +1688,10 @@ version(none) version(vsi)
replaceTokenSequence(tokens, "InterlockedCompareExchange($args __in LONG ExChange, __in LONG Comperand);", "$* +/", true);
replaceTokenSequence(tokens, "InterlockedOr(&Barrier, 0);", "InterlockedExchangeAdd(&Barrier, 0);", true); // InterlockedOr exist only as intrinsic
}
+ if (currentModule == "winerror")
+ {
+ replaceTokenSequence(tokens, "HRESULT HRESULT_FROM_SETUPAPI($args) { $code }", "/+ $* +/", true);
+ }
if(currentModule == "ocidl")
{
// move alias out of interface declaration, it causes circular definitions with dmd 2.065+
@@ -2134,6 +2173,8 @@ else
TokenIterator inAlias = tokens.end();
for(TokenIterator tokIt = tokens.begin(); !tokIt.atEnd(); ++tokIt)
{
+ bool isAssign(string txt) { return txt == "=" || txt == "&=" || txt == "|=" || txt == "+=" || txt == "-="; }
+
Token tok = *tokIt;
//tok.pretext = tok.pretext.replace("//D", "");
tok.text = translateToken(tok.text);
@@ -2150,8 +2191,9 @@ else
}
else if(tok.text == "[" && tokIt[1].text != "]")
{
- if((tokIt.atBegin() || tokIt[-1].text != "{" || tokIt[-2].text != "=") &&
+ if((tokIt.atBegin() || tokIt[-1].text != "{" || !isAssign(tokIt[-2].text)) &&
(tokIt[1].type != Token.Number || tokIt[2].text != "]") &&
+ tokIt[1].text != "i" && // RtlConstantTimeEqualMemory
(tokIt[2].text != "]" || tokIt[3].text != ";"))
{
TokenIterator bit = tokIt;
@@ -2168,8 +2210,9 @@ else
{
TokenIterator openit = tokIt;
if(retreatToOpeningBracket(openit) &&
- (openit.atBegin || (openit-1).atBegin || openit[-1].text != "{" || openit[-2].text != "="))
+ (openit.atBegin || (openit-1).atBegin || openit[-1].text != "{" || !isAssign(openit[-2].text)))
if((tokIt[-1].type != Token.Number || tokIt[-2].text != "[") &&
+ tokIt[-1].text != "i" && // RtlConstantTimeEqualMemory
(tokIt[-2].text != "[" || tokIt[1].text != ";"))
tok.text = "]+/";
}
@@ -2900,8 +2943,8 @@ unittest
string exptxt = "
int convert() { return " ~ "
hello; }
-// #define noconvert(n,m) \\
-// hallo1 |\\
+// #define noconvert(n,m)
+// hallo1 |
// hallo2
";
version(macro2template) exptxt = replace(exptxt, "int", "auto");
diff --git a/doc/VersionHistory.dd b/doc/VersionHistory.dd
index 787c3895..552af47c 100644
--- a/doc/VersionHistory.dd
+++ b/doc/VersionHistory.dd
@@ -9,8 +9,8 @@ $(H2 2022-06-05 Version 1.3.0)
$(LI bugzilla 22764: now searches the 32-bit registry hive for install paths of DMD and LDC)
$(LI bugzilla 23069: mago crashing when debugging VARIANT data type in VS 2022)
$(LI bugzilla 23043: project templates missing in VS 2022 until configuration manually updated)
- $(LI semantic analysis: without a project loaded, a D file is now analized using the compile options)
- $(LI of "Compile and Run" with an import path derived from the module declaration.)
+ $(LI semantic analysis: without a project loaded, a D file is now analyzed using the compile options
+ of "Compile and Run" with an import path derived from the module declaration.)
$(LI visualdproj: exit code printed for failed commands)
$(LI cv2pdb 0.52: improved DWARF support for non-contiguous functions, bug fixes)
)
diff --git a/msbuild/dbuild/dbuild.csproj b/msbuild/dbuild/dbuild.csproj
index 2e6411aa..c7b47486 100644
--- a/msbuild/dbuild/dbuild.csproj
+++ b/msbuild/dbuild/dbuild.csproj
@@ -159,6 +159,50 @@
MinimumRecommendedRules.ruleset
17.2
+
+ bin\Release-v17_3\
+ TRACE;TOOLS_V17
+ true
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ 17.3
+
+
+ bin\Debug-v17_3\
+ TRACE;DEBUG;TOOLS_V17
+ true
+ false
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ 17.3
+
+
+ bin\Release-v17_4\
+ TRACE;TOOLS_V17
+ true
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ 17.4
+
+
+ bin\Debug-v17_4\
+ TRACE;DEBUG;TOOLS_V17
+ true
+ false
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ 17.4
+
true
full
@@ -202,7 +246,7 @@
v4.6
v4.5.2
v4.7.2
- v4.7.2
+ v4.7.2
false
false
false
@@ -433,7 +477,7 @@
-
+
assemblies\v17\Microsoft.Build.dll
@@ -471,6 +515,16 @@
assemblies\v17_2\Microsoft.Build.CPPTasks.Common.dll
+
+
+ assemblies\v17_3\Microsoft.Build.CPPTasks.Common.dll
+
+
+
+
+ assemblies\v17_4\Microsoft.Build.CPPTasks.Common.dll
+
+
Designer
diff --git a/msbuild/dcompile.targets b/msbuild/dcompile.targets
index f5e45ffb..452607ec 100644
--- a/msbuild/dcompile.targets
+++ b/msbuild/dcompile.targets
@@ -136,7 +136,7 @@
Condition="'@(DCompile)' != '' and '$(DCompiler)' != 'None'"
DependsOnTargets="_collectDFiles;_replacePackageName">
-
+
diff --git a/msbuild/dcompile_defaults.props b/msbuild/dcompile_defaults.props
index 6a6738a4..e56853d0 100644
--- a/msbuild/dcompile_defaults.props
+++ b/msbuild/dcompile_defaults.props
@@ -49,7 +49,9 @@
16.1
17.0
17.1
- 17.2
+ 17.2
+ 17.3
+ 17.4
diff --git a/nsis/visuald.nsi b/nsis/visuald.nsi
index e21cfa1a..49c020b6 100644
--- a/nsis/visuald.nsi
+++ b/nsis/visuald.nsi
@@ -29,12 +29,12 @@
; define DMD source path to include dmd installation
; !define DMD
-!define DMD_VERSION "2.100.0"
+!define DMD_VERSION "2.100.2"
!define DMD_SRC c:\d\dmd-${DMD_VERSION}
; define LDC to include ldc installation
; !define LDC
-!define LDC_VERSION "1.29.0"
+!define LDC_VERSION "1.30.0"
!define LDC_SRC c:\d\ldc2-${LDC_VERSION}-windows-multilib
; define VS2019 to include VS2019 support
@@ -332,6 +332,8 @@ Section "Visual Studio package" SecPackage
${File} ..\msbuild\dbuild\obj\release-v17\ dbuild.17.0.dll
${File} ..\msbuild\dbuild\obj\release-v17_1\ dbuild.17.1.dll
${File} ..\msbuild\dbuild\obj\release-v17_2\ dbuild.17.2.dll
+ ${File} ..\msbuild\dbuild\obj\release-v17_3\ dbuild.17.3.dll
+ ${File} ..\msbuild\dbuild\obj\release-v17_4\ dbuild.17.4.dll
!endif
WriteRegStr HKLM "Software\${APPNAME}" "msbuild" $INSTDIR\msbuild
!endif
diff --git a/sdk/port/base.d b/sdk/port/base.d
index 59d1427e..3c8f91e9 100644
--- a/sdk/port/base.d
+++ b/sdk/port/base.d
@@ -175,6 +175,9 @@ enum CCM_TRANSLATEACCELERATOR = (WM_USER+97);
// msdbg*.d
alias ULONG32 XINT32;
+// Win SDK 10.0.22621.0
+struct _UNWIND_HISTORY_TABLE;
+
version(sdk) {}
else {
diff --git a/tools/tracegc.d b/tools/tracegc.d
index 905bfce8..5c1efaa2 100644
--- a/tools/tracegc.d
+++ b/tools/tracegc.d
@@ -321,7 +321,7 @@ class GCTraceProxy : GC
return p;
}
- BlkInfo qalloc(size_t size, uint bits, const TypeInfo ti) nothrow
+ BlkInfo qalloc(size_t size, uint bits, scope const TypeInfo ti) nothrow
{
BlkInfo bi = gc.qalloc(size, bits, ti);
traceAlloc(bi.base);
@@ -706,7 +706,7 @@ void dumpAddr(AddrTracePair[] traceMap, void* addr, size_t size)
filename = ": ";
auto xtra = dumpExtra(addr);
- trace_printf("%s(%d): %p %llx%.*s\n", filename, line, addr, cast(long) size, cast(int)xtra.length, xtra.ptr);
+ trace_printf("%s(%d): %p %llx %.*s\n", filename, line, addr, cast(long) size, cast(int)xtra.length, xtra.ptr);
}
struct AddrInfoStat
@@ -874,7 +874,8 @@ HashTab!(void*, void*) *g_references;
HashTab!(void*, size_t) *g_objects;
ConservativeGC g_cgc;
-void collectReferences(ConservativeGC cgc, ref HashTab!(void*, void*) references, ref HashTab!(void*, size_t) objects)
+void collectReferences(ConservativeGC cgc, bool precise,
+ ref HashTab!(void*, void*) references, ref HashTab!(void*, size_t) objects)
{
g_cgc = cgc;
g_references = &references;
@@ -895,7 +896,7 @@ void collectReferences(ConservativeGC cgc, ref HashTab!(void*, void*) references
*/
static void mark(bool precise)(Gcx.ScanRange!precise rng) nothrow
{
- auto pooltable = g_cgc.gcx.pooltable;
+ auto pooltable = g_cgc.gcx.pooltable;
alias toscan = scanStack!precise;
debug(MARK_PRINTF)
@@ -969,7 +970,7 @@ void collectReferences(ConservativeGC cgc, ref HashTab!(void*, void*) references
printf("\t\tfound pool %p, base=%p, pn = %lld, bin = %d\n", pool, pool.baseAddr, cast(long)pn, bin);
// Adjust bit to be at start of allocated memory block
- if (bin < B_PAGE)
+ if (bin < Bins.B_PAGE)
{
// We don't care abou setting pointsToBase correctly
// because it's ignored for small object pools anyhow.
@@ -994,7 +995,7 @@ void collectReferences(ConservativeGC cgc, ref HashTab!(void*, void*) references
goto LaddRange;
}
}
- else if (bin == B_PAGE)
+ else if (bin == Bins.B_PAGE)
{
biti = offset >> Pool.ShiftBy.Large;
//debug(PRINTF) printf("\t\tbiti = x%x\n", biti);
@@ -1018,7 +1019,7 @@ void collectReferences(ConservativeGC cgc, ref HashTab!(void*, void*) references
goto LaddLargeRange;
}
}
- else if (bin == B_PAGEPLUS)
+ else if (bin == Bins.B_PAGEPLUS)
{
pn -= pool.bPageOffsets[pn];
biti = pn * (PAGESIZE >> Pool.ShiftBy.Large);
@@ -1075,7 +1076,7 @@ void collectReferences(ConservativeGC cgc, ref HashTab!(void*, void*) references
else
{
// Don't mark bits in B_FREE pages
- assert(bin == B_FREE);
+ assert(bin == Bins.B_FREE);
}
}
LnextPtr:
@@ -1175,7 +1176,7 @@ void collectReferences(ConservativeGC cgc, ref HashTab!(void*, void*) references
//debug(PRINTF) printf("\t\tfound pool %p, base=%p, pn = %zd, bin = %d, biti = x%x\n", pool, pool.baseAddr, pn, bin, biti);
// Adjust bit to be at start of allocated memory block
- if (bin < B_PAGE)
+ if (bin < Bins.B_PAGE)
{
// We don't care abou setting pointsToBase correctly
// because it's ignored for small object pools anyhow.
@@ -1193,7 +1194,7 @@ void collectReferences(ConservativeGC cgc, ref HashTab!(void*, void*) references
break;
}
}
- else if (bin == B_PAGE)
+ else if (bin == Bins.B_PAGE)
{
auto offsetBase = offset & ~cast(size_t)(PAGESIZE-1);
base = pool.baseAddr + offsetBase;
@@ -1282,16 +1283,29 @@ void collectReferences(ConservativeGC cgc, ref HashTab!(void*, void*) references
thread_suspendAll();
cgc.gcx.prepare(); // set freebits
- foreach(root; cgc.rootIter)
- mark!true(Gcx.ScanRange!true(&root, &root + 1, null));
- foreach(range; cgc.rangeIter)
- mark!true(Gcx.ScanRange!true(range.pbot, range.ptop, null));
+ if (precise)
+ {
+ foreach(root; cgc.rootIter)
+ mark!true(Gcx.ScanRange!true(&root, &root + 1, null));
+ foreach(range; cgc.rangeIter)
+ mark!true(Gcx.ScanRange!true(range.pbot, range.ptop, null));
+ thread_scanAll((b, t) => mark!true(Gcx.ScanRange!true(b, t)));
+ }
+ else
+ {
+ foreach(root; cgc.rootIter)
+ mark!false(Gcx.ScanRange!false(&root, &root + 1));
+ foreach(range; cgc.rangeIter)
+ mark!false(Gcx.ScanRange!false(range.pbot, range.ptop));
+ thread_scanAll((b, t) => mark!false(Gcx.ScanRange!false(b, t)));
+ }
+
+ toscanConservative.clear();
+ toscanPrecise.clear();
g_cgc = null;
g_references = null;
g_objects = null;
- toscanConservative.clear();
- toscanPrecise.clear();
//thread_scanAll(&mark);
thread_resumeAll();
@@ -1329,7 +1343,7 @@ void dumpGC(GC _gc)
{
foreach (pn, bin; pool.pagetable[0 .. pool.npages])
{
- if (bin == B_PAGE)
+ if (bin == Bins.B_PAGE)
{
auto lpool = cast(LargeObjectPool*) pool;
size_t npages = lpool.bPageOffsets[pn];
@@ -1338,11 +1352,11 @@ void dumpGC(GC _gc)
dumpAddr(traceMap, addr, npages * PAGESIZE);
usedSize += npages * PAGESIZE;
}
- else if (bin == B_FREE)
+ else if (bin == Bins.B_FREE)
{
freeSize += PAGESIZE;
}
- else if (bin < B_PAGE)
+ else if (bin < Bins.B_PAGE)
{
immutable size = binsize[bin];
void *p = pool.baseAddr + pn * PAGESIZE;
@@ -1415,7 +1429,7 @@ void dumpGC(GC _gc)
Bins bin = cast(Bins)pool.pagetable[pn];
void* base = void;
- if (bin < B_PAGE)
+ if (bin < Bins.B_PAGE)
{
auto offsetBase = baseOffset(offset, cast(Bins)bin);
base = pool.baseAddr + offsetBase;
@@ -1423,12 +1437,12 @@ void dumpGC(GC _gc)
if (pool.freebits.test(biti))
continue;
}
- else if (bin == B_PAGE)
+ else if (bin == Bins.B_PAGE)
{
auto offsetBase = offset & ~cast(size_t)(PAGESIZE-1);
base = pool.baseAddr + offsetBase;
}
- else if (bin == B_PAGEPLUS)
+ else if (bin == Bins.B_PAGEPLUS)
{
pn -= pool.bPageOffsets[pn];
base = pool.baseAddr + (pn * PAGESIZE);
@@ -1575,7 +1589,7 @@ void findRoot(void* sobj)
HashTab!(void*, void*)* preferences = &references;
pp_references = &preferences;
- collectReferences(cgc, references, objects);
+ collectReferences(cgc, true, references, objects);
const(void*) minAddr = cgc.gcx.pooltable.minAddr;
const(void*) maxAddr = cgc.gcx.pooltable.maxAddr;
diff --git a/vdc/abothe/Parser b/vdc/abothe/Parser
index c4f7813b..43fb9e50 160000
--- a/vdc/abothe/Parser
+++ b/vdc/abothe/Parser
@@ -1 +1 @@
-Subproject commit c4f7813b69cf1ccf2125587da1a119264a3a60a7
+Subproject commit 43fb9e50ae0014964eb9b374488521c8d66d993e
diff --git a/vdc/dmdserver/dmd b/vdc/dmdserver/dmd
index b17fbeaf..ec6efcc1 160000
--- a/vdc/dmdserver/dmd
+++ b/vdc/dmdserver/dmd
@@ -1 +1 @@
-Subproject commit b17fbeaf48fe0fd4c7c8919495801620c4eb92ce
+Subproject commit ec6efcc17574b348efa683167f2be3c7dbb1c9da
diff --git a/vdc/dmdserver/dmdinit.d b/vdc/dmdserver/dmdinit.d
index 39bc9a22..a95f02e8 100644
--- a/vdc/dmdserver/dmdinit.d
+++ b/vdc/dmdserver/dmdinit.d
@@ -30,6 +30,7 @@ import dmd.objc;
import dmd.target;
import dmd.common.outbuffer;
+import dmd.root.ctfloat;
import std.string;
import core.stdc.string;
@@ -160,6 +161,7 @@ void dmdInit()
target._init(global.params); // needed by Type._init
Type._init();
Module._init();
+ CTFloat.initialize();
}
struct Options
@@ -353,6 +355,7 @@ void dmdSetupParams(const ref Options opts)
// for another platform/architecture, different versions)
void dmdReinit()
{
+ // Dsymbol.deinitialize();
target._init(global.params); // needed by Type._init
Type._reinit();
diff --git a/vdc/dmdserver/dmdrmem.d b/vdc/dmdserver/dmdrmem.d
index 539fc424..d2fed109 100644
--- a/vdc/dmdserver/dmdrmem.d
+++ b/vdc/dmdserver/dmdrmem.d
@@ -42,12 +42,12 @@ extern (C++) struct Mem
static void* xrealloc(void* p, size_t size) nothrow pure
{
- return GC.realloc(p, size);
+ return check(GC.realloc(p, size));
}
static void* xrealloc_noscan(void* p, size_t size) nothrow pure
{
- return GC.realloc(p, size, GC.BlkAttr.NO_SCAN);
+ return check(GC.realloc(p, size, GC.BlkAttr.NO_SCAN));
}
static void error() nothrow
@@ -55,10 +55,10 @@ extern (C++) struct Mem
__gshared static oom = new Error("out of memory");
throw oom;
}
- static void* check(void* p) nothrow
+ static void* check(void* p) nothrow pure
{
if (!p)
- error();
+ (cast(void function() nothrow pure)&error)();
return p;
}
diff --git a/vdc/dmdserver/dmdserver.d b/vdc/dmdserver/dmdserver.d
index f15c46e7..eb93bb86 100644
--- a/vdc/dmdserver/dmdserver.d
+++ b/vdc/dmdserver/dmdserver.d
@@ -336,11 +336,8 @@ class DMDServer : ComObject, IVDServer
version(traceGC)
{
- wipeStack();
- GC.collect();
- auto nstats = GC.stats();
- printf("reinit: stats.usedSize %zd -> %zd\n", stats.usedSize, nstats.usedSize);
- dumpGC();
+ mModules = null;
+ check_leaks();
}
else
GC.collect();
diff --git a/vdc/dmdserver/dmdserver.visualdproj b/vdc/dmdserver/dmdserver.visualdproj
index 6744e950..9302a36d 100644
--- a/vdc/dmdserver/dmdserver.visualdproj
+++ b/vdc/dmdserver/dmdserver.visualdproj
@@ -572,7 +572,7 @@
0
c:\l\d\dmd2\windows\bin\dmd.exe
dmd\src ..\..
- dmd dmd\src\dmd\res
+ dmd dmd\res dmd\src\dmd\res
..\..\bin\$(ConfigurationName)
$(OutDir)\$(PlatformName)\$(ProjectName)
@@ -1072,7 +1072,7 @@
0
c:\l\d\dmd2\windows\bin\dmd.exe
dmd\src ..\..
- dmd dmd\res
+ dmd dmd\res dmd\src\dmd\res
..\..\bin\$(ConfigurationName)
$(OutDir)\$(PlatformName)\$(ProjectName)
diff --git a/vdc/dmdserver/semanalysis.d b/vdc/dmdserver/semanalysis.d
index 75c1dc11..cd1506aa 100644
--- a/vdc/dmdserver/semanalysis.d
+++ b/vdc/dmdserver/semanalysis.d
@@ -235,7 +235,7 @@ string[] guessImportPaths()
{
import std.file;
- string path = r"c:\D\dmd-" ~ to!string(__VERSION__ * 0.001) ~ ".0";
+ string path = r"c:\D\dmd-" ~ to!string(__VERSION__)[0..1] ~ "." ~ to!string(__VERSION__)[1..$] ~ ".0";
if (std.file.exists(path ~ r"\src\druntime\import\object.d"))
return [ path ~ r"\src\druntime\import", path ~ r"\src\phobos" ];
path ~= "-beta.1";
@@ -1929,6 +1929,27 @@ unittest
checkOutline(source, 3, expected);
}
+void check_leaks()
+{
+ import core.memory;
+ import std.stdio;
+
+ //mModules = null;
+ lastContext = null;
+ Module.loadModuleHandler = null;
+ dmdInit();
+ dmdReinit();
+
+ version(traceGC)
+ wipeStack();
+ GC.collect();
+
+ auto stats = GC.stats;
+ writeln(stats);
+ version(traceGC)
+ dumpGC();
+}
+
void test_ana_dmd()
{
import core.memory;
@@ -1990,7 +2011,8 @@ void test_ana_dmd()
bool dump = false;
string source;
Module m;
- int i = 0; //foreach(i; 0..40)
+ int i = 0;
+ //foreach(i; 0..40)
{
filename = __FILE_FULL_PATH__;
source = cast(string)std.file.read(filename);
@@ -2004,17 +2026,16 @@ void test_ana_dmd()
m = checkErrors(source, "");
version(traceGC)
+ {
+ m = null;
+ check_leaks();
+ }
+ else
{
import std.stdio;
if ((i % 10) == 0)
GC.collect();
- auto stats = GC.stats;
- writeln(stats);
- }
- version(traceGC)
- {
- if (stats.usedSize >= 400_000_000)
- dumpGC();
+ writeln(GC.stats);
}
}
@@ -2032,7 +2053,8 @@ void test_ana_dmd()
}
}
}
- // test_sem();
+ test_sem();
+
void test_leaks()
{
bool dump = false;
@@ -2052,18 +2074,10 @@ void test_ana_dmd()
writeln(stats);
if (stats.usedSize > 200_000_000)
{
- //mModules = null;
m = null;
- lastContext = null;
- Module.loadModuleHandler = null;
- dmdInit();
- dmdReinit();
-
- wipeStack();
- GC.collect();
+ check_leaks();
auto nstats = GC.stats();
printf("reinit: stats.usedSize %zd -> %zd\n", stats.usedSize, nstats.usedSize);
- dumpGC();
}
}
}
diff --git a/visuald/config.d b/visuald/config.d
index 5a8ce448..bd6fb334 100644
--- a/visuald/config.d
+++ b/visuald/config.d
@@ -3191,12 +3191,14 @@ class Config : DisposingComObject,
{
cmd = getEnvironmentChanges() ~ cmd ~ addopt ~ "\n";
cmd ~= ":reportError\n";
- cmd ~= "set ERR=%ERRORLEVEL%\n";
- cmd ~= "if %ERR% LSS -65535 then ERR=0x%=EXITCODE%\n";
+ cmd ~= "set ERR=%ERRORLEVEL%\n"; // clears errorlevel
+ cmd ~= "set DISPERR=%ERR%\n";
+ cmd ~= "if %ERR% LSS -65535 then DISPERR=0x%=EXITCODE%\n";
if(syntaxOnly)
- cmd ~= "if %errorlevel% neq 0 echo Compiling " ~ file.GetFilename() ~ " failed (error code %ERR%)!\n";
+ cmd ~= "if %errorlevel% neq 0 echo Compiling " ~ file.GetFilename() ~ " failed (error code %DISPERR%)!\n";
else
- cmd ~= "if %errorlevel% neq 0 echo Building " ~ outfile ~ " failed (error code %ERR%)!\n";
+ cmd ~= "if %errorlevel% neq 0 echo Building " ~ outfile ~ " failed (error code %DISPERR%)!\n";
+ cmd ~= "exit /B %ERR%\n";
cmd = mProjectOptions.replaceEnvironment(cmd, this, file.GetFilename(), outfile);
}
return cmd;
@@ -3878,9 +3880,11 @@ class Config : DisposingComObject,
}
cmd ~= "\ngoto noError\n";
cmd ~= "\n:reportError\n";
- cmd ~= "set ERR=%ERRORLEVEL%\n";
- cmd ~= "if %ERR% LSS -65535 then ERR=0x%=EXITCODE%\n";
- cmd ~= "echo Building " ~ GetTargetPath() ~ " failed (error code %ERR%)!\n";
+ cmd ~= "set ERR=%ERRORLEVEL%\n"; // clears errorlevel
+ cmd ~= "set DISPERR=%ERR%\n";
+ cmd ~= "if %ERR% LSS -65535 then DISPERR=0x%=EXITCODE%\n";
+ cmd ~= "echo Building " ~ GetTargetPath() ~ " failed (error code %DISPERR%)!\n";
+ cmd ~= "exit /B %ERR%\n";
cmd ~= "\n:noError\n";
return mProjectOptions.replaceEnvironment(cmd, this);
diff --git a/visuald/pkgutil.d b/visuald/pkgutil.d
index bd2eae6a..284ae4de 100644
--- a/visuald/pkgutil.d
+++ b/visuald/pkgutil.d
@@ -240,18 +240,18 @@ void writeGCStatsToOutputPane()
GCStats stats = gc_stats();
writeToBuildOutputPane(format("numpools = %s, poolsize = %s, usedsize = %s, freelistsize = %s\n",
stats.numpools, stats.poolsize, stats.usedsize, stats.freelistsize));
- writeToBuildOutputPane(format("pool[B_16] = %s\n", stats.numpool[B_16] ));
- writeToBuildOutputPane(format("pool[B_32] = %s\n", stats.numpool[B_32] ));
- writeToBuildOutputPane(format("pool[B_64] = %s\n", stats.numpool[B_64] ));
- writeToBuildOutputPane(format("pool[B_128] = %s\n", stats.numpool[B_128] ));
- writeToBuildOutputPane(format("pool[B_256] = %s\n", stats.numpool[B_256] ));
- writeToBuildOutputPane(format("pool[B_512] = %s\n", stats.numpool[B_512] ));
- writeToBuildOutputPane(format("pool[B_1024] = %s\n", stats.numpool[B_1024] ));
- writeToBuildOutputPane(format("pool[B_2048] = %s\n", stats.numpool[B_2048] ));
- writeToBuildOutputPane(format("pool[B_PAGE] = %s\n", stats.numpool[B_PAGE] ));
- writeToBuildOutputPane(format("pool[B_PAGE+] = %s\n", stats.numpool[B_PAGEPLUS]));
- writeToBuildOutputPane(format("pool[B_FREE] = %s\n", stats.numpool[B_FREE] ));
- writeToBuildOutputPane(format("pool[B_UNCOM] = %s\n", stats.numpool[B_UNCOMMITTED]));
+ writeToBuildOutputPane(format("pool[B_16] = %s\n", stats.numpool[Bins.B_16] ));
+ writeToBuildOutputPane(format("pool[B_32] = %s\n", stats.numpool[Bins.B_32] ));
+ writeToBuildOutputPane(format("pool[B_64] = %s\n", stats.numpool[Bins.B_64] ));
+ writeToBuildOutputPane(format("pool[B_128] = %s\n", stats.numpool[Bins.B_128] ));
+ writeToBuildOutputPane(format("pool[B_256] = %s\n", stats.numpool[Bins.B_256] ));
+ writeToBuildOutputPane(format("pool[B_512] = %s\n", stats.numpool[Bins.B_512] ));
+ writeToBuildOutputPane(format("pool[B_1024] = %s\n", stats.numpool[Bins.B_1024] ));
+ writeToBuildOutputPane(format("pool[B_2048] = %s\n", stats.numpool[Bins.B_2048] ));
+ writeToBuildOutputPane(format("pool[B_PAGE] = %s\n", stats.numpool[Bins.B_PAGE] ));
+ writeToBuildOutputPane(format("pool[B_PAGE+] = %s\n", stats.numpool[Bins.B_PAGEPLUS]));
+ writeToBuildOutputPane(format("pool[B_FREE] = %s\n", stats.numpool[Bins.B_FREE] ));
+ writeToBuildOutputPane(format("pool[B_UNCOM] = %s\n", stats.numpool[Bins.B_UNCOMMITTED]));
writeClasses();
}