示例#1
0
        private HandlerAction DoExceptionEvent(ExceptionEvent e)
        {
            if (m_state == State.Paused)
            {
                // We'll land here if we get an exception when doing things like
                // calling into the debuggee to execute ToString methods.
                var frame = e.Thread.GetFrames()[0];
                Log.WriteLine(TraceLevel.Info, "Exception {0} in {1}:{2} while paused", e.Exception.Type.FullName, frame.Method.DeclaringType.Name, frame.Method.Name);

                return HandlerAction.Resume;
            }
            else
            {
                DoTransition(State.Paused);

                NSApplication.sharedApplication().BeginInvoke(() => m_debugger.OnException(e));

                return HandlerAction.Suspend;
            }
        }
示例#2
0
        internal void OnException(ExceptionEvent e)
        {
            var frames = new LiveStack(e.Thread);
            LiveStackFrame frame = frames[0];

            Boss boss = ObjectModel.Create("Application");
            var exceptions = boss.Get<IExceptions>();
            if (!DoIsIgnoredException(e.Exception.Type, exceptions.Ignored, frame.Method.Name))
            {
                m_currentThread = e.Thread;

                if (m_stepRequest != null)
                {
                    m_stepRequest.Disable();
                    m_stepRequest = null;
                }

                if (DebuggerWindows.WriteEvents)
                    m_transcript.WriteLine(Output.Normal, "{0} exception was thrown at {1}:{2:X4}", e.Exception.Type.FullName, frame.Method.FullName, frame.ILOffset);
                var context = new Context(e.Thread, frame.Method, frame.ILOffset);
                Broadcaster.Invoke("debugger thrown exception", context);
            }
            else
            {
                m_transcript.WriteLine(Output.Normal, "Ignoring {0} in {1}:{2}", e.Exception.Type.FullName, frame.Method.DeclaringType.Name, frame.Method.Name);
                m_thread.Resume();
            }
        }