import std.stdio;
void throws()
{
throw new Exception("hello world"); // should break here
}
void main()
{
scope(success)
writeln("hi");
throws(); // breaks here instead
}
This following program when built with debug symbols (-g -m64) and debugged with VC++ debugger, does not correctly break at the exception, but instead in the main function where throws is called. Possibly related to issue 15190.
Another issue with this code but without the scope(success) block, the debugger breaks in the object.Exception's constructor, which is also wrong, it should break at the line where throw is issued. Regressed in 2.086.0/1.
stack trace:
object.Exception@source\app.d(5): throws
----------------
0x00007FF64D20DCBC in app.throws at C:\D\dmd2\windows\bin\..\..\src\druntime\import\object.d(1975)
0x00007FF64D20DD00 in D main at C:\Users\GoaLitiuM\AppData\Local\Temp\New folder (6)\test\source\app.d(12)
0x00007FF64D2157B3 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll().__lambda1()
0x00007FF64D2155EC in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x00007FF64D2156EB in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x00007FF64D2155EC in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x00007FF64D21543D in d_run_main2
0x00007FF64D20F8D0 in d_run_main
0x00007FF64D20DDB2 in app._d_cmain!().main at C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\internal\entrypoint.d(34)
0x00007FF64D273A9C in __scrt_common_main_seh at d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl(288)
0x00007FF9278C7BD4 in BaseThreadInitThunk
0x00007FF92810CED1 in RtlUserThreadStart
Comment #1 by robert.schadek — 2024-12-13T19:06:08Z