digitalmars.D.learn - scope guards & debugger breakpoints?
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (6/6) May 21 2018 If I use scope(failure) with code that should be run if an exception is
- Steven Schveighoffer (6/9) May 21 2018 I'm not 100% sure but I expect:
- =?iso-8859-1?Q?Robert_M._M=FCnch?= (14/20) May 21 2018 When calling a function an then setting the breakpoint there, like in
- Steven Schveighoffer (14/36) May 21 2018 Seems like the debugger not understanding D source in that case.
If I use scope(failure) with code that should be run if an exception is thrown, how can I set a breakpoint for this code in the debugger? -- Robert M. Münch http://www.saphirion.com smarter | better | faster
May 21 2018
On 5/21/18 1:00 PM, Robert M. Münch wrote:If I use scope(failure) with code that should be run if an exception is thrown, how can I set a breakpoint for this code in the debugger?I'm not 100% sure but I expect: scope(failure) someCode(); putting a breakpoint on someCode should work. -Steve
May 21 2018
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. -- Robert M. Münch http://www.saphirion.com smarter | better | faster
May 21 2018
On 5/21/18 1:50 PM, Robert M. Münch wrote:On 2018-05-21 17:24:12 +0000, Steven Schveighoffer said: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. -SteveI'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.
May 21 2018