Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 14 additions & 3 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#define VERSION_MINOR 4
#define VERSION_REVISION 1
#define VERSION_BETA -beta
#define VERSION_BUILD 3
#define VERSION_BUILD 4
1 change: 1 addition & 0 deletions sdk/vsi.visualdproj
Original file line number Diff line number Diff line change
Expand Up @@ -2749,6 +2749,7 @@
<File path="vsi\msdbg1711.d" />
<File path="vsi\msdbg1712.d" />
<File path="vsi\msdbg1713.d" />
<File path="vsi\msdbg1714.d" />
<File path="vsi\msdbg172.d" />
<File path="vsi\msdbg173.d" />
<File path="vsi\msdbg174.d" />
Expand Down
6 changes: 6 additions & 0 deletions tools/pipedmd.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
5 changes: 5 additions & 0 deletions vdc/abothe/comserver/COM/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ static class Program
/// </summary>
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);
}
}
87 changes: 80 additions & 7 deletions vdc/dmdserver/semanalysis.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1553,6 +1591,33 @@ void do_unittests()
"#<source#source.d#>.#<tfun#source.d,16,15#>(#<source#source.d#>.#<Templ#source.d,2,12#>!int.#<S#source.d,4,11#> s)`", true);
checkTip(m, 18, 4, "`void #<source#source.d#>.#<tmplfun#source.d,21,8#>!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*)
Expand Down Expand Up @@ -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;
Expand Down
17 changes: 10 additions & 7 deletions visuald/propertypage.d
Original file line number Diff line number Diff line change
Expand Up @@ -3121,9 +3121,9 @@ struct MagoOptions
bool shortenTypeNames;
bool callDebuggerFunctions;
bool callDebuggerRanges;
bool callPropertyMethods;
bool callDebuggerUseMagoGC;
bool showDArrayLengthInType;
uint callPropertyMethods;
uint maxArrayElements;

void saveToRegistry()
Expand All @@ -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);
}

Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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"));
}

Expand Down Expand Up @@ -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));
}

Expand All @@ -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);

Expand All @@ -3293,9 +3296,9 @@ class MagoPropertyPage : ResizablePropertyPage
CheckBox mShortenTypeNames;
CheckBox mCallDebuggerFuncs;
CheckBox mCallDebuggerRange;
CheckBox mCallPropertyMethods;
CheckBox mCallDebugSwitchGC;
CheckBox mShowLengthInType;
ComboBox mCallPropertyMethods;
Text mMaxArrayElements;
}

Expand Down
Loading