scope guards & debugger breakpoints?
Steven Schveighoffer
schveiguy at yahoo.com
Mon May 21 21:24:10 UTC 2018
On 5/21/18 1:50 PM, Robert M. Münch wrote:
> On 2018-05-21 17:24:12 +0000, Steven Schveighoffer said:
>
>> I'm not 100% sure but I expect:
>>
>> scope(failure)
>> someCode();
>>
>> putting a breakpoint on someCode should work.
>
> When calling a function an then setting the breakpoint there, like in
> someCode() yes, that should work.
>
> I used code like this:
>
> scope(failure) {
> ... several lines of code
> }
>
> And for this it seems (maybe I need to check in more detail) that in
> MSVC, I can set a breakpoint, but the breakpoint is not triggered when
> an exception is thrown.
>
Seems like the debugger not understanding D source in that case.
What you could try is:
void breakOnThis()
{
return; // breakpoint here
}
scope(failure)
{
breakOnThis();
...
}
and then see where it goes when you step out of that function.
-Steve
More information about the Digitalmars-d-learn
mailing list