Пример #1
0
        internal Value(AppDomain appDomain, ICorDebugValue corValue)
        {
            if (corValue == null)
            {
                throw new ArgumentNullException("corValue");
            }
            this.appDomain             = appDomain;
            this.corValue              = corValue;
            this.corValue_pauseSession = this.Process.PauseSession;

            this.isNull = corValue is ICorDebugReferenceValue && ((ICorDebugReferenceValue)corValue).IsNull() != 0;

            if (corValue is ICorDebugReferenceValue &&
                ((ICorDebugReferenceValue)corValue).GetValue() == 0 &&
                ((ICorDebugValue2)corValue).GetExactType() == null)
            {
                // We were passed null reference and no metadata description
                // (happens during CreateThread callback for the thread object)
                this.type = appDomain.ObjectType;
            }
            else
            {
                ICorDebugType exactType = ((ICorDebugValue2)this.CorValue).GetExactType();
                this.type = DebugType.CreateFromCorType(appDomain, exactType);
            }
        }
Пример #2
0
        internal Value(Process process, Expression expression, ICorDebugValue corValue)
        {
            if (corValue == null)
            {
                throw new ArgumentNullException("corValue");
            }
            this.process               = process;
            this.expression            = expression;
            this.corValue              = corValue;
            this.corValue_pauseSession = process.PauseSession;

            if (corValue.Is <ICorDebugReferenceValue>() &&
                corValue.CastTo <ICorDebugReferenceValue>().Value == 0 &&
                corValue.CastTo <ICorDebugValue2>().ExactType == null)
            {
                // We were passed null reference and no metadata description
                // (happens during CreateThread callback for the thread object)
                this.type = DebugType.Create(this.Process, null, "System.Object");
            }
            else
            {
                ICorDebugType exactType = this.CorValue.CastTo <ICorDebugValue2>().ExactType;
                this.type = DebugType.Create(this.Process, exactType);
            }
        }
Пример #3
0
		/// <summary> Puts the process into a paused state </summary>
		internal void NotifyPaused(PausedReason pauseReason)
		{
			AssertRunning();
			pauseSession = new PauseSession(this, pauseReason);
			if (debuggeeState == null) {
				debuggeeState = new DebuggeeState(this);
			}
		}
Пример #4
0
		/// <summary> Puts the process into a resumed state </summary>
		internal void NotifyResumed(DebuggeeStateAction action)
		{
			AssertPaused();
			pauseSession = null;
			if (action == DebuggeeStateAction.Clear) {
				if (debuggeeState == null) throw new DebuggerException("Debugee state already cleared");
				debuggeeState = null;
				this.ExpressionsCache.Clear();
			}
		}
Пример #5
0
        public void Continue()
        {
            try
            {
                AssertPaused();


                pauseSession.NotifyHasExpired();
                pauseSession = null;
                OnDebuggingResumed();

                corProcess.Continue(0);
            }
            catch (System.Exception e)
            {
            }
        }
Пример #6
0
        public void Break()
        {
            AssertRunning();

            corProcess.Stop(100);             // TODO: Hardcoded value

            pauseSession = new PauseSession(PausedReason.ForcedBreak);

            // TODO: Code duplication from enter callback
            // Remove expired threads and functions
            foreach (Thread thread in this.Threads)
            {
                thread.CheckExpiration();
            }

            Pause(true);
        }
Пример #7
0
        internal Value(AppDomain appDomain, ICorDebugValue corValue)
        {
            if (corValue == null)
                throw new ArgumentNullException("corValue");
            this.appDomain = appDomain;
            this.corValue = corValue;
            this.corValue_pauseSession = this.Process.PauseSession;

            this.isNull = corValue is ICorDebugReferenceValue && ((ICorDebugReferenceValue)corValue).IsNull() != 0;

            if (corValue is ICorDebugReferenceValue &&
                ((ICorDebugReferenceValue)corValue).GetValue() == 0 &&
                ((ICorDebugValue2)corValue).GetExactType() == null)
            {
                // We were passed null reference and no metadata description
                // (happens during CreateThread callback for the thread object)
                this.type = appDomain.ObjectType;
            } else {
                ICorDebugType exactType = ((ICorDebugValue2)this.CorValue).GetExactType();
                this.type = DebugType.CreateFromCorType(appDomain, exactType);
            }
        }
Пример #8
0
		/// <summary> Puts the process into a resumed state </summary>
		internal void NotifyResumed(DebuggeeStateAction action)
		{
			AssertPaused();
			pauseSession = null;
			if (action == DebuggeeStateAction.Clear) {
				if (debuggeeState == null) throw new DebuggerException("Debugee state already cleared");
				debuggeeState = null;
				this.ExpressionsCache.Clear();
			}
		}
Пример #9
0
		/// <summary> Puts the process into a paused state </summary>
		internal void NotifyPaused(PausedReason pauseReason)
		{
			AssertRunning();
			pauseSession = new PauseSession(this, pauseReason);
			if (debuggeeState == null) {
				debuggeeState = new DebuggeeState(this);
			}
		}
Пример #10
0
 public void NotifyPaused(PauseSession pauseSession)
 {
     this.pauseSession = pauseSession;
 }
Пример #11
0
		public void Continue()
		{
			try
			{
			AssertPaused();
			
			
			pauseSession.NotifyHasExpired();
			pauseSession = null;
			OnDebuggingResumed();
			
			corProcess.Continue(0);
			}
			catch(System.Exception e)
			{
				
			}
		}
Пример #12
0
		public void Break()
		{
			AssertRunning();
			
			corProcess.Stop(100); // TODO: Hardcoded value
			
			pauseSession = new PauseSession(PausedReason.ForcedBreak);

			// TODO: Code duplication from enter callback
			// Remove expired threads and functions
			foreach(Thread thread in this.Threads) {
				thread.CheckExpiration();
			}
			
			Pause(true);
		}
Пример #13
0
		public void NotifyPaused(PauseSession pauseSession)
		{
			this.pauseSession = pauseSession;
		}
Пример #14
0
		internal Value(Process process, Expression expression, ICorDebugValue corValue)
		{
			if (corValue == null) {
				throw new ArgumentNullException("corValue");
			}
			this.process = process;
			this.expression = expression;
			this.corValue = corValue;
			this.corValue_pauseSession = process.PauseSession;
			
			if (corValue.Is<ICorDebugReferenceValue>() &&
			    corValue.CastTo<ICorDebugReferenceValue>().Value == 0 &&
			    corValue.CastTo<ICorDebugValue2>().ExactType == null)
			{
				// We were passed null reference and no metadata description
				// (happens during CreateThread callback for the thread object)
				this.type = DebugType.Create(this.Process, null, "System.Object");
			} else {
				ICorDebugType exactType = this.CorValue.CastTo<ICorDebugValue2>().ExactType;
				this.type = DebugType.Create(this.Process, exactType);
			}
		}