www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11549] New: Throwing an exception while debugging causes incorrect execution

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11549

           Summary: Throwing an exception while debugging causes incorrect
                    execution
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: VisualD
        AssignedTo: nobody puremagic.com
        ReportedBy: turkeyman gmail.com


--- Comment #0 from Manu <turkeyman gmail.com> 2013-11-18 23:00:26 PST ---
While debugging 32bit, when the program encounters a throw, the debugger stops
and produces a pop-up dialog box (even if the D exceptions are disabled in
"Debug -> Exceptions...".
The usual options are present (continue, ignore, terminate), but what happens
next gets weird.

With Mago:
 Pressing continue causes the program to continue execution _instead of
unwinding_ as if the exception were never thrown, which leads to execution of
code that shouldn't be reachable.
 This completely changes the execution path of code while debugging (doesn't
ever enter any catch blocks), and since code following the throw shouldn't be
reachable, it typically crashes immediately.

With Visual Studio's debugger:
 Pressing 'continue' then produces a second request "Would you like to pass the
exception back to the program being debugged".
 Choosing 'yes' then produces the first dialog box again, and choosing
'continue' from there repeats the first dialog over and over continuously from
every single point in the unwind process, although the code does appear to
successfully unwind.

This is a critical issue while debugging. It is impossible to debug code that
contains exceptions with either debugger. Mago is simply broken, and visual
studio is practically unusable.

Are there any known work-arounds?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 18 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11549


Rainer Schuetze <r.sagitario gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario gmx.de


--- Comment #1 from Rainer Schuetze <r.sagitario gmx.de> 2013-11-19 00:30:26
PST ---
See also issue 11033.

I don't have the same issues you describe, though I mostly use the VS debugger.
Which VS version and debug engine do you use? Do you have "native edit and
continue" enabled (see the VS 2012 section at
http://rainers.github.io/visuald/visuald/Debugging.html )

Regarding the issues with the exceptions dislaog not being functional for mago,
this might be related to the "Exceptions with Mago" section on the same page.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 19 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11549



--- Comment #2 from Manu <turkeyman gmail.com> 2013-11-19 02:51:10 PST ---
(In reply to comment #1)
 See also issue 11033.
Ah sorry, that's also mine. I didn't see that it was migrated. Sorry!
 I don't have the same issues you describe, though I mostly use the VS debugger.
 Which VS version and debug engine do you use? Do you have "native edit and
 continue" enabled (see the VS 2012 section at
 http://rainers.github.io/visuald/visuald/Debugging.html )
I'm using VS2010, so I guess that option doesn't apply? I described the behaviour under both Mago and Visual Studio. Neither of them are working in an acceptable manner for me.
 Regarding the issues with the exceptions dislaog not being functional for mago,
 this might be related to the "Exceptions with Mago" section on the same page.
I have all D Exceptions unchecked. I don't want it to break on exceptions at all, but I can't seem to control it with those options. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 19 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11549



--- Comment #3 from Rainer Schuetze <r.sagitario gmx.de> 2013-11-24 10:01:06
PST ---
I just tried it again with the example referenced by issue 11033: it just works
for me.

What you describe for mago is what happens when you press "ignore", but that is
expected behaviour. The same holds for answering "no" to the "Pass exception on
to program being debugged?" question when continuing after stopping at the
exception. Do these options behave identically for you?

Regarding stopping on specific exceptions: if you want to treat an exception
differently than others, it must be added explicitely to the list of
exceptions, e.g. as "main.WLServException". Mago doesn't check base classes of
an unlisted exception.

I'm using VS2010, so I guess that option doesn't apply?
Yes, it is only for VS2012 and later.
I have all D Exceptions unchecked. I don't want it to break on exceptions at
all, but I can't seem to control it with those options.
The "D Exceptions" top level entry is only for mago, disabling this root entry and all sub-entries should work. The VS debug engine interprets D's exceptions as Win32 Exceptions, so you'll have to disable entry 0xe0440001. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 24 2013