diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index dff67afc..58384d33 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -14,7 +14,7 @@ env: jobs: build: # windows-latest doesn't have .net framework 4.0 - runs-on: windows-2019 + runs-on: windows-2022 steps: - name: Checkout visuald diff --git a/CHANGES b/CHANGES index 88b25d5c..a7318a36 100644 --- a/CHANGES +++ b/CHANGES @@ -1430,7 +1430,18 @@ Version history module names are removed when displayed - issue #305: mago: with option "Call property methods implicitly in expression evaluation" methods annotated with @property and without arguments are evaluated without parentheses - - format options could be erratic when execution function for expression evaluation - - fixed selecting the zero-argument method in case multiple overloads - - added format specifiers 'd' (decimmal), 'x' (hex), '@' (evaluate function automatically) + - format options could be erratic when executing functions for expression evaluation + - fixed selecting the zero-argument method in case of multiple overloads + - added format specifiers 'd' (decimal), 'x' (hex), '@' (evaluate function automatically) - added a couple of caches for better responsiveness + - changed mago options are now applied with the next step in the debugger, no restart of + the debug session required anymore + +2025-07-03 version 1.4.1-beta4 + * mago: + - added option to select what type of property functions that can now be implicitly called. + - fixed calling functions with slices or larger structs + - improve shortened names in call stack + - better propagate the raw option modifier (!) to expanded expressions + - don't fail enumerating child expressions if one fails, show error for this item instead + * dmdserver: fixed intellisense on TemplateInstance!Argument diff --git a/VERSION b/VERSION index 91272250..5435b41c 100644 --- a/VERSION +++ b/VERSION @@ -2,4 +2,4 @@ #define VERSION_MINOR 4 #define VERSION_REVISION 1 #define VERSION_BETA -beta -#define VERSION_BUILD 3 +#define VERSION_BUILD 4 diff --git a/sdk/vsi.visualdproj b/sdk/vsi.visualdproj index 797822a9..503ad581 100644 --- a/sdk/vsi.visualdproj +++ b/sdk/vsi.visualdproj @@ -2749,6 +2749,7 @@ + diff --git a/tools/pipedmd.d b/tools/pipedmd.d index 9aa28962..bb055465 100644 --- a/tools/pipedmd.d +++ b/tools/pipedmd.d @@ -146,6 +146,12 @@ int main(string[] argv) } else if(argv[skipargs + 1] == "-deps") depsfile = argv[skipargs += 2]; + + else if(argv[skipargs + 1] == "--") // allow --DRT arguments for callee + { + skipargs++; + break; + } else break; } diff --git a/vdc/abothe/comserver/COM/Program.cs b/vdc/abothe/comserver/COM/Program.cs index d1299cc1..b067c2e3 100644 --- a/vdc/abothe/comserver/COM/Program.cs +++ b/vdc/abothe/comserver/COM/Program.cs @@ -7,8 +7,13 @@ static class Program /// static void Main(string[] args) { + SetErrorMode(3); //don't show JitDebugger on crash + // Run the out-of-process COM server ExeCOMServer.Instance.Run(); } + + [DllImport("Kernel32.dll")] + public static extern uint SetErrorMode(uint mode); } } \ No newline at end of file diff --git a/vdc/dmdserver/dmd b/vdc/dmdserver/dmd index 82d33907..11d592ed 160000 --- a/vdc/dmdserver/dmd +++ b/vdc/dmdserver/dmd @@ -1 +1 @@ -Subproject commit 82d33907b3390915ead9b18c896a179313b4365e +Subproject commit 11d592ed08822900b6e8b3c209314d3a0ac76b68 diff --git a/vdc/dmdserver/semanalysis.d b/vdc/dmdserver/semanalysis.d index 8da4051f..28ca54d2 100644 --- a/vdc/dmdserver/semanalysis.d +++ b/vdc/dmdserver/semanalysis.d @@ -253,13 +253,51 @@ Module analyzeModule(Module parsedModule, const ref Options opts) debug { - auto __debugOverview(Identifier id) => id ? id.toString : null; - auto __debugOverview(Dsymbol s) => s && s.ident ? s.ident.toString : null; - auto __debugOverview(ref const Loc loc) => loc.toChars(); - auto __debugExpanded(ref const Loc loc) => { - struct S { const(char)* filename; int line; } - return S(loc.filename, loc.linnum); - }(); + auto __debugOverview(Identifier id) + { + try + { + return id ? id.toString : null; + } + catch(Throwable t) + { + return t.msg; + } + } + auto __debugOverview(Dsymbol s) + { + try + { + return s ? s.toString : null; + } + catch(Throwable t) + { + return t.msg; + } + } + auto __debugOverview(ref const Loc loc) + { + try + { + return loc.toChars(); + } + catch(Throwable t) + { + return t.msg.ptr; + } + } + auto __debugExpanded(ref const Loc loc) + { + struct S { const(char)* filename; int line; int col; } + try + { + return S(loc.filename, loc.linnum, loc.charnum); + } + catch(Throwable t) + { + return S(t.msg.ptr, 0, 0); + } + } } //////////////////////////////////////////////////////////////// @@ -1553,6 +1591,33 @@ void do_unittests() "#.#(#.#!int.# s)`", true); checkTip(m, 18, 4, "`void #.#!int(int x) pure nothrow @nogc @safe`", true); + // check template arguments + source = q{ + class Expression + { + int op; + } // Line 5 + T ctfeEmplaceExp(T : Expression, Args...)(Args args) + { + return new T(args); + } + void fun(Expression e) // Line 10 + { + e = ctfeEmplaceExp!Expression(); + }; + }; + m = checkErrors(source, ""); + + import dmd.common.outbuffer; + import dmd.hdrgen; + auto buf = OutBuffer(); + buf.doindent = 1; + moduleToBuffer(buf, true, m); + auto modstr = buf.extractData(); + + checkTip(m, 12, 17, "`source.Expression source.ctfeEmplaceExp!(source.Expression)() pure nothrow @safe`"); + checkTip(m, 12, 23, "(class) `source.Expression`"); + // check FQN types in cast source = q{ void foo(Error*) @@ -2183,6 +2248,14 @@ void test_ana_dmd() dumpGC(); } + void test_file(string srcfile) + { + string src = cast(string)std.file.read(srcfile); + filename = srcfile; + Module m = checkErrors(src, ""); + } + test_file(std.path.buildPath(srcdir, r"..\test\runnable\testaa2.d")); + void test_sem() { bool dump = false; diff --git a/visuald/propertypage.d b/visuald/propertypage.d index c92f44b6..eab55a1d 100644 --- a/visuald/propertypage.d +++ b/visuald/propertypage.d @@ -3121,9 +3121,9 @@ struct MagoOptions bool shortenTypeNames; bool callDebuggerFunctions; bool callDebuggerRanges; - bool callPropertyMethods; bool callDebuggerUseMagoGC; bool showDArrayLengthInType; + uint callPropertyMethods; uint maxArrayElements; void saveToRegistry() @@ -3140,9 +3140,9 @@ struct MagoOptions keyMago.Set("shortenTypeNames", shortenTypeNames); keyMago.Set("callDebuggerFunctions", callDebuggerFunctions); keyMago.Set("callDebuggerRanges", callDebuggerRanges); - keyMago.Set("callPropertyMethods", callPropertyMethods); keyMago.Set("callDebuggerUseMagoGC", callDebuggerUseMagoGC); keyMago.Set("showDArrayLengthInType", showDArrayLengthInType); + keyMago.Set("callPropertyMethods", callPropertyMethods); keyMago.Set("maxArrayElements", maxArrayElements); } @@ -3161,9 +3161,9 @@ struct MagoOptions shortenTypeNames = (keyMago.GetDWORD("shortenTypeNames", 1) != 0); callDebuggerFunctions = (keyMago.GetDWORD("callDebuggerFunctions", 1) != 0); callDebuggerRanges = (keyMago.GetDWORD("callDebuggerRanges", 0) != 0); - callPropertyMethods = (keyMago.GetDWORD("callPropertyMethods", 0) != 0); callDebuggerUseMagoGC = (keyMago.GetDWORD("callDebuggerUseMagoGC", 1) != 0); showDArrayLengthInType = (keyMago.GetDWORD("showDArrayLengthInType", 0) != 0); + callPropertyMethods = keyMago.GetDWORD("callPropertyMethods", 0); maxArrayElements = keyMago.GetDWORD("maxArrayElements", 1000); } } @@ -3195,7 +3195,10 @@ class MagoPropertyPage : ResizablePropertyPage AddTitleLine("Function Execution"); AddControl("", mCallDebuggerFuncs = new CheckBox(mCanvas, "Call struct/class methods __debug[Overview|Expanded|StringView]")); AddControl("", mCallDebuggerRange = new CheckBox(mCanvas, "Call range methods to show elements in overview/expansion")); - AddControl("", mCallPropertyMethods = new CheckBox(mCanvas, "Call property methods implicitly in expression evaluation")); + kLabelWidth = kPageWidth * 9 / 16; + AddControl("Call property methods in expression evaluation if", + mCallPropertyMethods = new ComboBox(mCanvas, [ "Never", "@property const pure", "@property const", "@property", "@property/const pure" ], false)); + kLabelWidth = saveWidth; AddControl("", mCallDebugSwitchGC = new CheckBox(mCanvas, "Switch GC while executing debugger functions")); } @@ -3250,9 +3253,9 @@ class MagoPropertyPage : ResizablePropertyPage mShortenTypeNames.setChecked(mOptions.shortenTypeNames); mCallDebuggerFuncs.setChecked(mOptions.callDebuggerFunctions); mCallDebuggerRange.setChecked(mOptions.callDebuggerRanges); - mCallPropertyMethods.setChecked(mOptions.callPropertyMethods); mCallDebugSwitchGC.setChecked(mOptions.callDebuggerUseMagoGC); mShowLengthInType.setChecked(mOptions.showDArrayLengthInType); + mCallPropertyMethods.setSelection(mOptions.callPropertyMethods); mMaxArrayElements.setText(to!string(mOptions.maxArrayElements)); } @@ -3270,7 +3273,7 @@ class MagoPropertyPage : ResizablePropertyPage changes += changeOption(mShortenTypeNames.isChecked(), opts.shortenTypeNames, refopts.shortenTypeNames); changes += changeOption(mCallDebuggerFuncs.isChecked(), opts.callDebuggerFunctions, refopts.callDebuggerFunctions); changes += changeOption(mCallDebuggerRange.isChecked(), opts.callDebuggerRanges, refopts.callDebuggerRanges); - changes += changeOption(mCallPropertyMethods.isChecked(), opts.callPropertyMethods, refopts.callPropertyMethods); + changes += changeOption(mCallPropertyMethods.getSelection(), opts.callPropertyMethods, refopts.callPropertyMethods); changes += changeOption(mCallDebugSwitchGC.isChecked(), opts.callDebuggerUseMagoGC, refopts.callDebuggerUseMagoGC); changes += changeOption(mShowLengthInType.isChecked(), opts.showDArrayLengthInType, refopts.showDArrayLengthInType); @@ -3293,9 +3296,9 @@ class MagoPropertyPage : ResizablePropertyPage CheckBox mShortenTypeNames; CheckBox mCallDebuggerFuncs; CheckBox mCallDebuggerRange; - CheckBox mCallPropertyMethods; CheckBox mCallDebugSwitchGC; CheckBox mShowLengthInType; + ComboBox mCallPropertyMethods; Text mMaxArrayElements; }