コード例 #1
0
 public MDANotificationDebugCallbackEventArgs(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
     : base(pController)
 {
     Controller = pController;
     Thread     = pThread;
     MDA        = pMDA;
 }
コード例 #2
0
 private DebuggeeProcess GetProcessWrapper(ICorDebugController controller)
 {
     if (controller is ICorDebugAppDomain)
         return GetProcessWrapper(controller as ICorDebugAppDomain);
     else if (controller is ICorDebugProcess)
         return GetProcessWrapper(controller as ICorDebugProcess);
     return null;
 }
コード例 #3
0
 internal IDebuggerController GetController(ICorDebugController controller)
 {
     if (controller is ICorDebugAppDomain)
     {
         return(GetAppDomain(controller as ICorDebugAppDomain));
     }
     return(this);
 }
コード例 #4
0
        public void MDANotification(ICorDebugController c, ICorDebugThread t, ICorDebugMDA mda)
        {
            ManagedCallback managedCallback = GetProcessCallbackInterface(c);

            if (managedCallback != null)
            {
                managedCallback.MDANotification(c, t, mda);
            }
        }
コード例 #5
0
		public ManagedCallback GetProcessCallbackInterface(string name, ICorDebugController c)
		{
			if (c is ICorDebugAppDomain) {
				return GetProcessCallbackInterface(name, (ICorDebugAppDomain)c);
			} else if (c is ICorDebugProcess){
				return GetProcessCallbackInterface(name, (ICorDebugProcess)c);
			} else {
				throw new System.Exception("Unknown callback argument");
			}
		}
コード例 #6
0
		public ManagedCallback GetProcessCallbackInterface(string name, ICorDebugController c)
		{
			if (c.Is<ICorDebugAppDomain>()) {
				return GetProcessCallbackInterface(name, c.CastTo<ICorDebugAppDomain>());
			} else if (c.Is<ICorDebugProcess>()){
				return GetProcessCallbackInterface(name, c.CastTo<ICorDebugProcess>());
			} else {
				throw new System.Exception("Unknown callback argument");
			}
		}
コード例 #7
0
        private void HandleEvent(ICorDebugController controller, bool finalize = true)
        {
            var process = GetProcessWrapper(controller);
            var eventArgs = new DebuggerEventArgs(process.GetController(controller), true);

            process.DispatchEvent(eventArgs);

            if (finalize)
                FinalizeEvent(eventArgs);
        }
コード例 #8
0
 void ICorDebugManagedCallback2.MDANotification(
     ICorDebugController pController,
     ICorDebugThread thread,
     ICorDebugMDA pMDA)
 {
     if (DebugOutput)
     {
         Console.WriteLine("info: MDANotification2");
     }
     pController.Continue(0);
 }
コード例 #9
0
 private DebuggeeProcess GetProcessWrapper(ICorDebugController controller)
 {
     if (controller is ICorDebugAppDomain)
     {
         return(GetProcessWrapper(controller as ICorDebugAppDomain));
     }
     else if (controller is ICorDebugProcess)
     {
         return(GetProcessWrapper(controller as ICorDebugProcess));
     }
     return(null);
 }
コード例 #10
0
        private void HandleEvent(ICorDebugController controller, bool finalize = true)
        {
            var process   = GetProcessWrapper(controller);
            var eventArgs = new DebuggerEventArgs(process.GetController(controller), true);

            process.DispatchEvent(eventArgs);

            if (finalize)
            {
                FinalizeEvent(eventArgs);
            }
        }
コード例 #11
0
 public ManagedCallback GetProcessCallbackInterface(ICorDebugController c)
 {
     if (c.Is <ICorDebugAppDomain>())
     {
         return(GetProcessCallbackInterface(c.CastTo <ICorDebugAppDomain>()));
     }
     else if (c.Is <ICorDebugProcess>())
     {
         return(GetProcessCallbackInterface(c.CastTo <ICorDebugProcess>()));
     }
     else
     {
         throw new System.Exception("Unknown callback argument");
     }
 }
コード例 #12
0
 public ManagedCallback GetProcessCallbackInterface(string name, ICorDebugController c)
 {
     if (c is ICorDebugAppDomain)
     {
         return(GetProcessCallbackInterface(name, (ICorDebugAppDomain)c));
     }
     else if (c is ICorDebugProcess)
     {
         return(GetProcessCallbackInterface(name, (ICorDebugProcess)c));
     }
     else
     {
         throw new System.Exception("Unknown callback argument");
     }
 }
コード例 #13
0
        /// <exception cref="Exception">Unknown callback argument</exception>
        public void MDANotification(ICorDebugController c, ICorDebugThread t, ICorDebugMDA mda)
        {
            if (c is ICorDebugAppDomain)
            {
                EnterCallback(PausedReason.Other, "MDANotification", (ICorDebugAppDomain)c);
            }
            else if (c is ICorDebugProcess)
            {
                EnterCallback(PausedReason.Other, "MDANotification", (ICorDebugProcess)c);
            }
            else
            {
                throw new System.Exception("Unknown callback argument");
            }

            ExitCallback();
        }
コード例 #14
0
        public void MDANotification(ICorDebugController c, ICorDebugThread t, ICorDebugMDA mda)
        {
            if (c.Is <ICorDebugAppDomain>())
            {
                EnterCallback(PausedReason.Other, "MDANotification", c.CastTo <ICorDebugAppDomain>());
            }
            else if (c.Is <ICorDebugProcess>())
            {
                EnterCallback(PausedReason.Other, "MDANotification", c.CastTo <ICorDebugProcess>());
            }
            else
            {
                throw new System.Exception("Unknown callback argument");
            }

            ExitCallback_Continue();
        }
コード例 #15
0
ファイル: Program.cs プロジェクト: erisonliang/qizmt
            public void MDANotification(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
            {
                try
                {
                    _EnterCallback();

                    lock (dbgproc)
                    {
                        string desc;
                        {
                            uint len = 0;
                            pMDA.GetDescription(len, out len, IntPtr.Zero);
                            IntPtr pdesc = Marshal.AllocHGlobal((int)len * 2);
                            pMDA.GetDescription(len, out len, pdesc);
                            desc = Marshal.PtrToStringUni(pdesc, (int)len);
                            if (desc.EndsWith("\0"))
                            {
                                desc = desc.Substring(0, desc.Length - 1);
                            }
                            Marshal.FreeHGlobal(pdesc);
                        }
                        dbgproc.dout.WriteLine("MDA notification: {0}", desc);
                    }

                    _CallbackEvent("MDANotification", true);
                }
                catch (Exception e)
                {
                    _CallbackException(e);
                }
            }
コード例 #16
0
 public virtual void MDANotification(ICorDebugController controller, ICorDebugThread thread, ICorDebugMDA mda)
 {
     this.DefaultHandler(controller);
 }
コード例 #17
0
ファイル: ManagedCallback.cs プロジェクト: anvaka/slinject
 public void MDANotification(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
 {
     pController.Continue(0);
 }
コード例 #18
0
 int ICorDebugAppDomain.SetAllThreadsDebugState(CorDebugThreadState state, ICorDebugThread pExceptThisThread)
 {
     return(ICorDebugController.SetAllThreadsDebugState(state, pExceptThisThread));
 }
コード例 #19
0
 //This need to be called in Process Creaded notification
 public static void SetStateObj(ICorDebugController value)
 {
     if (stateObj != null) { throw new Exception("Already initialized"); }
     stateObj = new ControllerStateObject(value);
 }
コード例 #20
0
 int ICorDebugAppDomain.HasQueuedCallbacks(ICorDebugThread pThread, out int pbQueued)
 {
     return(ICorDebugController.HasQueuedCallbacks(pThread, out pbQueued));
 }
コード例 #21
0
 int ICorDebugAppDomain.Continue(int fIsOutOfBand)
 {
     return(ICorDebugController.Continue(fIsOutOfBand));
 }
コード例 #22
0
 public void CreateProcess(ICorDebugProcess pProcess)
 {
     controller = pProcess;
     controller.Continue(0);
 }
コード例 #23
0
ファイル: DnDebugger.cs プロジェクト: nakijun/dnSpy
		bool Continue(ICorDebugController controller) {
			Debug.Assert(controller != null);
			if (controller == null)
				return false;

			int hr = controller.Continue(0);
			continueCounter++;
			bool success = hr >= 0 || hr == CordbgErrors.CORDBG_E_PROCESS_TERMINATED || hr == CordbgErrors.CORDBG_E_OBJECT_NEUTERED;
			Debug.WriteLineIf(!success, string.Format("dndbg: ICorDebugController::Continue() failed: 0x{0:X8}", hr));
			return success;
		}
コード例 #24
0
 int ICorDebugAppDomain.CommitChanges(uint cSnapshots, ref ICorDebugEditAndContinueSnapshot pSnapshots, out ICorDebugErrorInfoEnum pError)
 {
     return(ICorDebugController.CommitChanges(cSnapshots, ref pSnapshots, out pError));
 }
コード例 #25
0
 int ICorDebugAppDomain.Terminate(uint exitCode)
 {
     return(ICorDebugController.Terminate(exitCode));
 }
コード例 #26
0
 int ICorDebugAppDomain.Detach()
 {
     return(ICorDebugController.Detach());
 }
コード例 #27
0
		/// <exception cref="Exception">Unknown callback argument</exception>
		public void MDANotification(ICorDebugController c, ICorDebugThread t, ICorDebugMDA mda)
		{
			if (c is ICorDebugAppDomain) {
				EnterCallback("MDANotification", (ICorDebugAppDomain)c);
			} else if (c is ICorDebugProcess){
				EnterCallback("MDANotification", (ICorDebugProcess)c);
			} else {
				throw new System.Exception("Unknown callback argument");
			}
			
			ExitCallback();
		}
コード例 #28
0
 internal IDebuggerController GetController(ICorDebugController controller)
 {
     if (controller is ICorDebugAppDomain)
         return GetAppDomain(controller as ICorDebugAppDomain);
     return this;
 }
コード例 #29
0
ファイル: Debugger.cs プロジェクト: fedorw/monodevelop
 // Get process from controller 
 static private CorProcess GetProcessFromController(ICorDebugController pController)
 {
     CorProcess p;
     ICorDebugProcess p2 = pController as ICorDebugProcess;
     if (p2 != null)
     {
         p = CorProcess.GetCorProcess(p2);
     }
     else
     {
         ICorDebugAppDomain a2 = (ICorDebugAppDomain)pController;
         p = new CorAppDomain(a2).Process;
     }
     return p;
 }
コード例 #30
0
 int ICorDebugAppDomain.IsRunning(out int pbRunning)
 {
     return(ICorDebugController.IsRunning(out pbRunning));
 }
コード例 #31
0
ファイル: Controller.cs プロジェクト: pusp/o2platform
 internal CorController(ICorDebugController controller)
     : base(controller)
 {
     m_controller = controller;
 }
コード例 #32
0
ファイル: Program.cs プロジェクト: DeanYQ/donet-debugger
 public void MDANotification([In, MarshalAs(UnmanagedType.Interface)] ICorDebugController pController, [In, MarshalAs(UnmanagedType.Interface)] ICorDebugThread pThread, [In, MarshalAs(UnmanagedType.Interface)] ICorDebugMDA pMDA)
 {
     throw new NotImplementedException();
 }
コード例 #33
0
ファイル: CorController.cs プロジェクト: tylike/mindbg
 /// <summary>
 /// Creates an instance of the controller.
 /// </summary>
 /// <param name="cocntrl">ICorDebugController instance</param>
 internal CorController(ICorDebugController cocntrl, CorDebuggerOptions options)
     : base(cocntrl, options)
 {
     this.cocntrl = cocntrl;
 }
コード例 #34
0
		protected DebugCallbackEventArgs(ICorDebugController ctrl) {
			this.ctrl = ctrl;
		}
コード例 #35
0
 public void MDANotification(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
 {
     throw new NotImplementedException();
 }
コード例 #36
0
 int ICorDebugAppDomain.EnumerateThreads(out ICorDebugThreadEnum ppThreads)
 {
     return(ICorDebugController.EnumerateThreads(out ppThreads));
 }
コード例 #37
0
ファイル: Program.cs プロジェクト: DeanYQ/donet-debugger
 public void HandleEvent(ICorDebugController controller)
 {
     Console.WriteLine("event received");
     controller.Continue(0);
 }
コード例 #38
0
 public void MDANotification(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
 {
     HandleEvent(pController);
 }
コード例 #39
0
		public void MDANotification(ICorDebugController c, ICorDebugThread t, ICorDebugMDA mda)
		{
			ManagedCallback managedCallback = GetProcessCallbackInterface("MDANotification", c);
			if (managedCallback != null) {
				managedCallback.MDANotification(c, t, mda);
			}
		}
コード例 #40
0
ファイル: DebuggerCallBacks.cs プロジェクト: xinyanmsft/clrmd
 public virtual void MDANotification(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
 {
     pController.Continue(0);
 }
コード例 #41
0
		public MDANotificationDebugCallbackEventArgs(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
			: base(pController) {
			this.Controller = pController;
			this.Thread = pThread;
			this.MDA = pMDA;
		}
コード例 #42
0
		public void MDANotification(ICorDebugController c, ICorDebugThread t, ICorDebugMDA mda)
		{
			if (c.Is<ICorDebugAppDomain>()) {
				EnterCallback(PausedReason.Other, "MDANotification", c.CastTo<ICorDebugAppDomain>());
			} else if (c.Is<ICorDebugProcess>()){
				EnterCallback(PausedReason.Other, "MDANotification", c.CastTo<ICorDebugProcess>());
			} else {
				throw new System.Exception("Unknown callback argument");
			}
			
			ExitCallback_Continue();
		}
コード例 #43
0
 internal Controller(ICorDebugController controller)
 {
     m_controller = controller;
 }
コード例 #44
0
 public void MDANotification(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
 {
     Console.WriteLine("MDANotification");
     pController.Continue(0);
 }
コード例 #45
0
 protected virtual void DefaultHandler(ICorDebugController controller)
 {
     controller.Continue(false);
 }
コード例 #46
0
 public void MDANotification(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
 {
     HandleEvent(pController);
 }
コード例 #47
0
 void ICorDebugManagedCallback2.MDANotification(ICorDebugController pController, ICorDebugThread pThread, ICorDebugMDA pMDA)
 {
     // TODO nothing for now
 }
コード例 #48
0
 protected DebugCallbackEventArgs(ICorDebugController ctrl)
 {
     CorDebugController = ctrl;
 }
コード例 #49
0
ファイル: DnDebugger.cs プロジェクト: lovebanyi/dnSpy
        // This method must be called just before returning to the caller. No fields can be accessed
        // and no methods can be called because the CLR debugger could call us before this method
        // returns.
        bool Continue(ICorDebugController controller, bool callOnProcessStateChanged)
        {
            Debug.Assert(controller != null);
            if (controller == null)
                return false;

            if (callOnProcessStateChanged && managedCallbackCounter == 1) {
                try {
                    continuing = true;
                    CallOnProcessStateChanged();
                }
                finally {
                    continuing = false;
                }
            }
            managedCallbackCounter--;
            continueCounter++;

            if (callOnProcessStateChanged && managedCallbackCounter == 0)
                CallOnProcessStateChanged();

            // As soon as we call Continue(), the CLR debugger could send us another message so it's
            // important that we don't access any of our fields and don't call any methods after
            // Continue() has been called!
            int hr = controller.Continue(0);
            bool success = hr >= 0 || hr == CordbgErrors.CORDBG_E_PROCESS_TERMINATED || hr == CordbgErrors.CORDBG_E_OBJECT_NEUTERED;
            Debug.WriteLineIf(!success, string.Format("dndbg: ICorDebugController::Continue() failed: 0x{0:X8}", hr));
            return success;
        }
コード例 #50
0
 internal ControllerStateObject(ICorDebugController contoller)
 {
     m_Controller = contoller;
 }
コード例 #51
0
ファイル: Debugger.cs プロジェクト: fedorw/monodevelop
        void ICorDebugManagedCallback2.MDANotification(ICorDebugController pController,
                                                       ICorDebugThread thread,
                                                       ICorDebugMDA pMDA)
        {
            CorMDA c = new CorMDA(pMDA);
            string szName = c.Name;
            CorDebugMDAFlags f = c.Flags;
            CorProcess p = GetProcessFromController(pController);


            HandleEvent(ManagedCallbackType.OnMDANotification,
                                      new CorMDAEventArgs(c,
                                                           thread == null ? null : new CorThread(thread),
                                                           p, ManagedCallbackType.OnMDANotification));
        }
コード例 #52
0
 int ICorDebugAppDomain.Stop(uint dwTimeout)
 {
     return(ICorDebugController.Stop(dwTimeout));
 }