예제 #1
0
파일: Process.cs 프로젝트: pusp/o2platform
 /// <summary>
 /// Creates a new instance of the CustomBreakpointEventArgs class.
 /// </summary>
 /// <param name="processController"></param>
 /// <param name="callbackArgs"></param>
 public CustomBreakpointEventArgs(IMDbgProcessController processController,
                                  CorBreakpointEventArgs callbackArgs)
     : base(processController)
 {
     this.callbackArgs = callbackArgs;
 }
예제 #2
0
파일: Process.cs 프로젝트: pusp/o2platform
        //////////////////////////////////////////////////////////////////////////////////
        //
        // Callbacks implementation
        //
        //////////////////////////////////////////////////////////////////////////////////

        private void BreakpointEventHandler(Object sender, CorBreakpointEventArgs e)
        {
         /*   if (DI.o2MDbg.AutoContinueOnBreakPointEvent)
            {
                O2MDbgUtils.setCurrentLocationFromActiveThread();
                return;         // DC (if this is set means some other breakpoint handler has already processed this and set the e.Continue flag to true
            }*/
            OriginalMDbgMessages.WriteLine("ManagedCallback::Breakpoint");
            if (InternalHandleRawMode(ManagedCallbackType.OnBreakpoint, e))
                return;

            // custom breakpoint handling. All normal MDbg shell breakpoints (including our user breakpoint)
            // register their own handlers here, so this is the very common case.
            if (customBreakpoints != null
                && customBreakpoints.Contains(e.Breakpoint))
            {
                using (var psc = new MDbgProcessStopController(this, e, false))
                {
                    var handler = (customBreakpoints[e.Breakpoint] as CustomBreakpointEventHandler);

                    // Invoke custom callback handler. This may stop the shell.                    
                    handler(this, new CustomBreakpointEventArgs(psc, e));
                }
                return; // this was custom breakpoint, no additional action necessary.
            }

            // We have an unknown breakpoint that no handler was registered for. This should be a very
            // uncommon case and indicate some bug in MDbg or an extension.
            e.Continue = false;
            InternalSignalRuntimeIsStopped(e.Thread, "Unexpected raw breakpoint hit");
        }