Esempio n. 1
0
        public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType exceptionType, uint dwFlags)
        {
            EnterCallback(PausedReason.Exception, "Exception2 (type=" + exceptionType.ToString() + ")", pThread);

            // This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
            // Whatch out for the zeros and null!
            // Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);

            process.SelectedThread.CurrentExceptionType = (ExceptionType)exceptionType;

            if (ExceptionType.DEBUG_EXCEPTION_UNHANDLED != (ExceptionType)exceptionType)
            {
                // Handled exception
                if (process.PauseOnHandledException)
                {
                    ExitCallback_Paused();
                }
                else
                {
                    ExitCallback_Continue();
                }
            }
            else
            {
                // Unhandled exception
                ExitCallback_Paused();
            }
        }
Esempio n. 2
0
        public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType _exceptionType, uint dwFlags)
        {
            EnterCallback(PausedReason.Exception, "Exception2 (type=" + _exceptionType.ToString() + ")", pThread);

            // This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
            // Watch out for the zeros and null!
            // Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);

            ExceptionType exceptionType  = (ExceptionType)_exceptionType;
            bool          pauseOnHandled = !process.Evaluating && process.Options != null && process.Options.PauseOnHandledExceptions;

            if (exceptionType == ExceptionType.Unhandled || (pauseOnHandled && exceptionType == ExceptionType.CatchHandlerFound))
            {
                // sanity check: we can only handle one exception after another
                // TODO : create Exception queue if CLR throws multiple exceptions
                Debug.Assert(process.SelectedThread.CurrentException == null);
                process.SelectedThread.CurrentException = new Exception(new Value(process.AppDomains[pAppDomain], process.SelectedThread.CorThread.GetCurrentException()).GetPermanentReference());
                process.SelectedThread.CurrentException_DebuggeeState = process.DebuggeeState;
                process.SelectedThread.CurrentExceptionType           = exceptionType;
                process.SelectedThread.CurrentExceptionIsUnhandled    = exceptionType == ExceptionType.Unhandled;

                pauseOnNextExit = true;
            }

            ExitCallback();
        }
Esempio n. 3
0
        public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType exceptionType, uint dwFlags)
        {
            EnterCallback(PausedReason.Exception, "Exception2 (type=" + exceptionType.ToString() + ")", pThread);

            // This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
            // Watch out for the zeros and null!
            // Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);

            if ((ExceptionType)exceptionType == ExceptionType.Unhandled || process.PauseOnHandledException)
            {
                process.SelectedThread.CurrentException = new Exception(new Value(process.AppDomains[pAppDomain], process.SelectedThread.CorThread.GetCurrentException()).GetPermanentReference());
                process.SelectedThread.CurrentException_DebuggeeState = process.DebuggeeState;
                process.SelectedThread.CurrentExceptionType           = (ExceptionType)exceptionType;
                process.SelectedThread.CurrentExceptionIsUnhandled    = (ExceptionType)exceptionType == ExceptionType.Unhandled;

                pauseOnNextExit = true;
            }
            ExitCallback();
        }
        public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType _exceptionType, uint dwFlags)
        {
            EnterCallback("Exception2 (type=" + _exceptionType.ToString() + ")", pThread);

            // This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
            // Watch out for the zeros and null!
            // Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);

            ExceptionType exceptionType  = (ExceptionType)_exceptionType;
            bool          pauseOnHandled = !process.Evaluating && process.Options != null && process.Options.PauseOnHandledExceptions;
            Thread        thread         = process.GetThread(pThread);

            if (exceptionType == ExceptionType.Unhandled || (pauseOnHandled && exceptionType == ExceptionType.CatchHandlerFound && BreakOnException(thread)))
            {
                // Multiple exceptions can happen at the same time on multiple threads
                // (I have managed to create a test application to trigger it)
                thread.CurrentExceptionType = exceptionType;
                RequestPause(thread).ExceptionsThrown.Add(thread);
            }

            ExitCallback();
        }
Esempio n. 5
0
		public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType _exceptionType, uint dwFlags)
		{
			EnterCallback("Exception2 (type=" + _exceptionType.ToString() + ")", pThread);
			
			// This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
			// Watch out for the zeros and null!
			// Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);
			
			ExceptionType exceptionType = (ExceptionType)_exceptionType;
			bool pauseOnHandled = !process.Evaluating && process.Options != null && process.Options.PauseOnHandledExceptions;
			Thread thread = process.GetThread(pThread);
			
			if (exceptionType == ExceptionType.Unhandled || (pauseOnHandled && exceptionType == ExceptionType.CatchHandlerFound && BreakOnException(thread))) {
				
				// Multiple exceptions can happen at the same time on multiple threads
				// (I have managed to create a test application to trigger it)
				thread.CurrentExceptionType = exceptionType;
				RequestPause(thread).ExceptionsThrown.Add(thread);
			}
			
			ExitCallback();
		}
Esempio n. 6
0
		public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType exceptionType, uint dwFlags)
		{
			EnterCallback(PausedReason.Exception, "Exception2 (type=" + exceptionType.ToString() + ")", pThread);
			
			// This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
			// Watch out for the zeros and null!
			// Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);
			
			if ((ExceptionType)exceptionType == ExceptionType.Unhandled || process.PauseOnHandledException) {
				process.SelectedThread.CurrentException = new Exception(new Value(process.AppDomains[pAppDomain], process.SelectedThread.CorThread.GetCurrentException()).GetPermanentReference());
				process.SelectedThread.CurrentException_DebuggeeState = process.DebuggeeState;
				process.SelectedThread.CurrentExceptionType = (ExceptionType)exceptionType;
				process.SelectedThread.CurrentExceptionIsUnhandled = (ExceptionType)exceptionType == ExceptionType.Unhandled;
			
				pauseOnNextExit = true;
			}
			ExitCallback();
		}
Esempio n. 7
0
		public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType _exceptionType, uint dwFlags)
		{
			EnterCallback(PausedReason.Exception, "Exception2 (type=" + _exceptionType.ToString() + ")", pThread);
			
			// This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
			// Watch out for the zeros and null!
			// Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);
			
			ExceptionType exceptionType = (ExceptionType)_exceptionType;
			bool pauseOnHandled = !process.Evaluating && process.Options != null && process.Options.PauseOnHandledExceptions;
			
			if (exceptionType == ExceptionType.Unhandled || (pauseOnHandled && exceptionType == ExceptionType.CatchHandlerFound)) {
				// sanity check: we can only handle one exception after another
				// TODO : create Exception queue if CLR throws multiple exceptions
				Debug.Assert(process.SelectedThread.CurrentException == null);
				process.SelectedThread.CurrentException = new Exception(new Value(process.AppDomains[pAppDomain], process.SelectedThread.CorThread.GetCurrentException()).GetPermanentReference());
				process.SelectedThread.CurrentException_DebuggeeState = process.DebuggeeState;
				process.SelectedThread.CurrentExceptionType = exceptionType;
				process.SelectedThread.CurrentExceptionIsUnhandled = exceptionType == ExceptionType.Unhandled;
				
				pauseOnNextExit = true;
			}
			
			ExitCallback();
		}
Esempio n. 8
0
		public void Exception2(ICorDebugAppDomain pAppDomain, ICorDebugThread pThread, ICorDebugFrame pFrame, uint nOffset, CorDebugExceptionCallbackType exceptionType, uint dwFlags)
		{
			EnterCallback(PausedReason.Exception, "Exception2 (type=" + exceptionType.ToString() + ")", pThread);
			
			// This callback is also called from Exception(...)!!!! (the .NET 1.1 version)
			// Whatch out for the zeros and null!
			// Exception -> Exception2(pAppDomain, pThread, null, 0, exceptionType, 0);
			
			process.SelectedThread.CurrentExceptionType = (ExceptionType)exceptionType;
			
			if (ExceptionType.DEBUG_EXCEPTION_UNHANDLED != (ExceptionType)exceptionType) {
				// Handled exception
				if (process.PauseOnHandledException) {
					ExitCallback_Paused();
				} else {
					ExitCallback_Continue();					
				}
			} else {
				// Unhandled exception				
				ExitCallback_Paused();
			}
		}