Skip to content

Commit efe8d3b

Browse files
authored
Merge pull request #309 from rainers/master
Visual D v1.4.1-beta4
2 parents ca75e9d + 0ca1761 commit efe8d3b

File tree

9 files changed

+119
-20
lines changed

9 files changed

+119
-20
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ env:
1414
jobs:
1515
build:
1616
# windows-latest doesn't have .net framework 4.0
17-
runs-on: windows-2019
17+
runs-on: windows-2022
1818

1919
steps:
2020
- name: Checkout visuald

CHANGES

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,7 +1430,18 @@ Version history
14301430
module names are removed when displayed
14311431
- issue #305: mago: with option "Call property methods implicitly in expression evaluation"
14321432
methods annotated with @property and without arguments are evaluated without parentheses
1433-
- format options could be erratic when execution function for expression evaluation
1434-
- fixed selecting the zero-argument method in case multiple overloads
1435-
- added format specifiers 'd' (decimmal), 'x' (hex), '@' (evaluate function automatically)
1433+
- format options could be erratic when executing functions for expression evaluation
1434+
- fixed selecting the zero-argument method in case of multiple overloads
1435+
- added format specifiers 'd' (decimal), 'x' (hex), '@' (evaluate function automatically)
14361436
- added a couple of caches for better responsiveness
1437+
- changed mago options are now applied with the next step in the debugger, no restart of
1438+
the debug session required anymore
1439+
1440+
2025-07-03 version 1.4.1-beta4
1441+
* mago:
1442+
- added option to select what type of property functions that can now be implicitly called.
1443+
- fixed calling functions with slices or larger structs
1444+
- improve shortened names in call stack
1445+
- better propagate the raw option modifier (!) to expanded expressions
1446+
- don't fail enumerating child expressions if one fails, show error for this item instead
1447+
* dmdserver: fixed intellisense on TemplateInstance!Argument

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
#define VERSION_MINOR 4
33
#define VERSION_REVISION 1
44
#define VERSION_BETA -beta
5-
#define VERSION_BUILD 3
5+
#define VERSION_BUILD 4

sdk/vsi.visualdproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2749,6 +2749,7 @@
27492749
<File path="vsi\msdbg1711.d" />
27502750
<File path="vsi\msdbg1712.d" />
27512751
<File path="vsi\msdbg1713.d" />
2752+
<File path="vsi\msdbg1714.d" />
27522753
<File path="vsi\msdbg172.d" />
27532754
<File path="vsi\msdbg173.d" />
27542755
<File path="vsi\msdbg174.d" />

tools/pipedmd.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ int main(string[] argv)
146146
}
147147
else if(argv[skipargs + 1] == "-deps")
148148
depsfile = argv[skipargs += 2];
149+
150+
else if(argv[skipargs + 1] == "--") // allow --DRT arguments for callee
151+
{
152+
skipargs++;
153+
break;
154+
}
149155
else
150156
break;
151157
}

vdc/abothe/comserver/COM/Program.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ static class Program
77
/// </summary>
88
static void Main(string[] args)
99
{
10+
SetErrorMode(3); //don't show JitDebugger on crash
11+
1012
// Run the out-of-process COM server
1113
ExeCOMServer.Instance.Run();
1214
}
15+
16+
[DllImport("Kernel32.dll")]
17+
public static extern uint SetErrorMode(uint mode);
1318
}
1419
}

vdc/dmdserver/semanalysis.d

Lines changed: 80 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,51 @@ Module analyzeModule(Module parsedModule, const ref Options opts)
253253

254254
debug
255255
{
256-
auto __debugOverview(Identifier id) => id ? id.toString : null;
257-
auto __debugOverview(Dsymbol s) => s && s.ident ? s.ident.toString : null;
258-
auto __debugOverview(ref const Loc loc) => loc.toChars();
259-
auto __debugExpanded(ref const Loc loc) => {
260-
struct S { const(char)* filename; int line; }
261-
return S(loc.filename, loc.linnum);
262-
}();
256+
auto __debugOverview(Identifier id)
257+
{
258+
try
259+
{
260+
return id ? id.toString : null;
261+
}
262+
catch(Throwable t)
263+
{
264+
return t.msg;
265+
}
266+
}
267+
auto __debugOverview(Dsymbol s)
268+
{
269+
try
270+
{
271+
return s ? s.toString : null;
272+
}
273+
catch(Throwable t)
274+
{
275+
return t.msg;
276+
}
277+
}
278+
auto __debugOverview(ref const Loc loc)
279+
{
280+
try
281+
{
282+
return loc.toChars();
283+
}
284+
catch(Throwable t)
285+
{
286+
return t.msg.ptr;
287+
}
288+
}
289+
auto __debugExpanded(ref const Loc loc)
290+
{
291+
struct S { const(char)* filename; int line; int col; }
292+
try
293+
{
294+
return S(loc.filename, loc.linnum, loc.charnum);
295+
}
296+
catch(Throwable t)
297+
{
298+
return S(t.msg.ptr, 0, 0);
299+
}
300+
}
263301
}
264302

265303
////////////////////////////////////////////////////////////////
@@ -1553,6 +1591,33 @@ void do_unittests()
15531591
"#<source#source.d#>.#<tfun#source.d,16,15#>(#<source#source.d#>.#<Templ#source.d,2,12#>!int.#<S#source.d,4,11#> s)`", true);
15541592
checkTip(m, 18, 4, "`void #<source#source.d#>.#<tmplfun#source.d,21,8#>!int(int x) pure nothrow @nogc @safe`", true);
15551593

1594+
// check template arguments
1595+
source = q{
1596+
class Expression
1597+
{
1598+
int op;
1599+
} // Line 5
1600+
T ctfeEmplaceExp(T : Expression, Args...)(Args args)
1601+
{
1602+
return new T(args);
1603+
}
1604+
void fun(Expression e) // Line 10
1605+
{
1606+
e = ctfeEmplaceExp!Expression();
1607+
};
1608+
};
1609+
m = checkErrors(source, "");
1610+
1611+
import dmd.common.outbuffer;
1612+
import dmd.hdrgen;
1613+
auto buf = OutBuffer();
1614+
buf.doindent = 1;
1615+
moduleToBuffer(buf, true, m);
1616+
auto modstr = buf.extractData();
1617+
1618+
checkTip(m, 12, 17, "`source.Expression source.ctfeEmplaceExp!(source.Expression)() pure nothrow @safe`");
1619+
checkTip(m, 12, 23, "(class) `source.Expression`");
1620+
15561621
// check FQN types in cast
15571622
source = q{
15581623
void foo(Error*)
@@ -2183,6 +2248,14 @@ void test_ana_dmd()
21832248
dumpGC();
21842249
}
21852250

2251+
void test_file(string srcfile)
2252+
{
2253+
string src = cast(string)std.file.read(srcfile);
2254+
filename = srcfile;
2255+
Module m = checkErrors(src, "");
2256+
}
2257+
test_file(std.path.buildPath(srcdir, r"..\test\runnable\testaa2.d"));
2258+
21862259
void test_sem()
21872260
{
21882261
bool dump = false;

visuald/propertypage.d

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,9 +3121,9 @@ struct MagoOptions
31213121
bool shortenTypeNames;
31223122
bool callDebuggerFunctions;
31233123
bool callDebuggerRanges;
3124-
bool callPropertyMethods;
31253124
bool callDebuggerUseMagoGC;
31263125
bool showDArrayLengthInType;
3126+
uint callPropertyMethods;
31273127
uint maxArrayElements;
31283128

31293129
void saveToRegistry()
@@ -3140,9 +3140,9 @@ struct MagoOptions
31403140
keyMago.Set("shortenTypeNames", shortenTypeNames);
31413141
keyMago.Set("callDebuggerFunctions", callDebuggerFunctions);
31423142
keyMago.Set("callDebuggerRanges", callDebuggerRanges);
3143-
keyMago.Set("callPropertyMethods", callPropertyMethods);
31443143
keyMago.Set("callDebuggerUseMagoGC", callDebuggerUseMagoGC);
31453144
keyMago.Set("showDArrayLengthInType", showDArrayLengthInType);
3145+
keyMago.Set("callPropertyMethods", callPropertyMethods);
31463146
keyMago.Set("maxArrayElements", maxArrayElements);
31473147
}
31483148

@@ -3161,9 +3161,9 @@ struct MagoOptions
31613161
shortenTypeNames = (keyMago.GetDWORD("shortenTypeNames", 1) != 0);
31623162
callDebuggerFunctions = (keyMago.GetDWORD("callDebuggerFunctions", 1) != 0);
31633163
callDebuggerRanges = (keyMago.GetDWORD("callDebuggerRanges", 0) != 0);
3164-
callPropertyMethods = (keyMago.GetDWORD("callPropertyMethods", 0) != 0);
31653164
callDebuggerUseMagoGC = (keyMago.GetDWORD("callDebuggerUseMagoGC", 1) != 0);
31663165
showDArrayLengthInType = (keyMago.GetDWORD("showDArrayLengthInType", 0) != 0);
3166+
callPropertyMethods = keyMago.GetDWORD("callPropertyMethods", 0);
31673167
maxArrayElements = keyMago.GetDWORD("maxArrayElements", 1000);
31683168
}
31693169
}
@@ -3195,7 +3195,10 @@ class MagoPropertyPage : ResizablePropertyPage
31953195
AddTitleLine("Function Execution");
31963196
AddControl("", mCallDebuggerFuncs = new CheckBox(mCanvas, "Call struct/class methods __debug[Overview|Expanded|StringView]"));
31973197
AddControl("", mCallDebuggerRange = new CheckBox(mCanvas, "Call range methods to show elements in overview/expansion"));
3198-
AddControl("", mCallPropertyMethods = new CheckBox(mCanvas, "Call property methods implicitly in expression evaluation"));
3198+
kLabelWidth = kPageWidth * 9 / 16;
3199+
AddControl("Call property methods in expression evaluation if",
3200+
mCallPropertyMethods = new ComboBox(mCanvas, [ "Never", "@property const pure", "@property const", "@property", "@property/const pure" ], false));
3201+
kLabelWidth = saveWidth;
31993202
AddControl("", mCallDebugSwitchGC = new CheckBox(mCanvas, "Switch GC while executing debugger functions"));
32003203
}
32013204

@@ -3250,9 +3253,9 @@ class MagoPropertyPage : ResizablePropertyPage
32503253
mShortenTypeNames.setChecked(mOptions.shortenTypeNames);
32513254
mCallDebuggerFuncs.setChecked(mOptions.callDebuggerFunctions);
32523255
mCallDebuggerRange.setChecked(mOptions.callDebuggerRanges);
3253-
mCallPropertyMethods.setChecked(mOptions.callPropertyMethods);
32543256
mCallDebugSwitchGC.setChecked(mOptions.callDebuggerUseMagoGC);
32553257
mShowLengthInType.setChecked(mOptions.showDArrayLengthInType);
3258+
mCallPropertyMethods.setSelection(mOptions.callPropertyMethods);
32563259
mMaxArrayElements.setText(to!string(mOptions.maxArrayElements));
32573260
}
32583261

@@ -3270,7 +3273,7 @@ class MagoPropertyPage : ResizablePropertyPage
32703273
changes += changeOption(mShortenTypeNames.isChecked(), opts.shortenTypeNames, refopts.shortenTypeNames);
32713274
changes += changeOption(mCallDebuggerFuncs.isChecked(), opts.callDebuggerFunctions, refopts.callDebuggerFunctions);
32723275
changes += changeOption(mCallDebuggerRange.isChecked(), opts.callDebuggerRanges, refopts.callDebuggerRanges);
3273-
changes += changeOption(mCallPropertyMethods.isChecked(), opts.callPropertyMethods, refopts.callPropertyMethods);
3276+
changes += changeOption(mCallPropertyMethods.getSelection(), opts.callPropertyMethods, refopts.callPropertyMethods);
32743277
changes += changeOption(mCallDebugSwitchGC.isChecked(), opts.callDebuggerUseMagoGC, refopts.callDebuggerUseMagoGC);
32753278
changes += changeOption(mShowLengthInType.isChecked(), opts.showDArrayLengthInType, refopts.showDArrayLengthInType);
32763279

@@ -3293,9 +3296,9 @@ class MagoPropertyPage : ResizablePropertyPage
32933296
CheckBox mShortenTypeNames;
32943297
CheckBox mCallDebuggerFuncs;
32953298
CheckBox mCallDebuggerRange;
3296-
CheckBox mCallPropertyMethods;
32973299
CheckBox mCallDebugSwitchGC;
32983300
CheckBox mShowLengthInType;
3301+
ComboBox mCallPropertyMethods;
32993302
Text mMaxArrayElements;
33003303
}
33013304

0 commit comments

Comments
 (0)