Bug 11343 - Exception Handling doesn't work correctly in debugger.
Summary: Exception Handling doesn't work correctly in debugger.
Alias: None
Product: Runtime
Classification: Mono
Component: Debugger ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-03-21 20:09 UTC by Jake Simpson
Modified: 2017-07-07 19:11 UTC (History)
5 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jake Simpson 2013-03-21 20:09:33 UTC
Many times, when stepping through code, if I am to step into a function (which may well call other functions) that at some point in the tree I KNOW it's going to throw an exception, the step into doesn't work and I just get taken directly to the exception handler.

The only way to get around this is to work out where the code is going and go stick a break point in the function being called.

This is very very annoying, since often the call is redirected or overriden in some degree of inheritance, which makes knowing where the code is *actually* going quite tough.

This is running the IOS simulator.
Comment 1 Jeffrey Stedfast 2013-03-21 21:34:18 UTC
I *think* this is a bug in the Mono runtime and not in the IDE. Reassigning to Zoltan so he can take a look at this one.
Comment 2 Zoltan Varga 2013-03-23 23:51:31 UTC
What monotouch/xamarin.ios version is this ? Could you create a testcase/test project which reproduces the issue ? Does this happen when stepping into framework code, or user code ?
Comment 3 Jake Simpson 2013-04-04 15:14:05 UTC
More information.

This is actually worse than I had originally thought. On the Target, exception handling is worse than it is in the simulator.

In the simulator, sometimes when I step into a function where, at some point down the chain, I'm going to get an exception, it just jumps directly to the catch of the exception. 

However, on the target, when the exception gets fired, it jumps directly to a random position in code. The stack trace looks right, but if I try and open any of the function calls, it just hits the random position each time.

It literally says "An exception has been called" and then the actual position in the document view is on the opening bracket of a function that is never called in this chain. The contents of the exception are correct though, if I look inside.

In terms of monotouch, I am using the very latest - I let Xamarin Studio update the version I am using appropriately.

I cannot give you a repro test project since it's happening inside my project, which is a port of an existing LARGE XNA project and I'm time pressured to get this working.
Comment 4 Zoltan Varga 2013-04-05 12:12:01 UTC
Does this happen when stepping into framework code, or stepping in on a line which contains property accessors ? Do you have the 'Debug project code only' or 'Step over properties and operators' options set ?
Comment 5 Ludovic Henry 2017-07-07 19:11:03 UTC
If you can still reproduce with latest mono version, please feel free to reopen the bug. Thank you.