// Common on-hit handler. void InternalOnHitHandler(object sender, CustomBreakpointEventArgs e) { // Mark call to derived class. object stopreason = this.OnHitHandler(e); // If stop-reason supplied, then stop the shell. if (stopreason != null) { e.Controller.Stop(e.BreakpointHitCallbackArgs.Thread, stopreason); } }
/// <summary> Callback invoked when a breakpoint is hit. </summary> /// <returns> Return null to continue running past this breakpoint. Returns a non-null object /// to use as stop-reason to stop the process. </returns> /// <remarks> Derived classes can override this callback. This is fired during a raw debug managed /// debug event (directly from ICorDebugManagedCallback) and so the implementor can only do inspection /// operations. It can't resume the process (return null instead of a stop-reason to do that), and it /// certainly can't expect any other debuge events to come in. /// For example, DON'T do soemthing like setup a func-eval, continue the process, and wait for the /// eval complete event. /// </remarks> public virtual object OnHitHandler(CustomBreakpointEventArgs e) { // Default impl stops at all breakpoints. return(new BreakpointHitStopReason(this)); }