/// <summary> /// Check if the event is the Loader Breakpoint, and if so, deal with it. /// </summary> /// <param name="nativeEvent">event</param> /// <remarks>Loader breakpoint is generally the first breakpoint event</remarks> public void HandleIfLoaderBreakpoint(NativeEvent nativeEvent, ref bool loaderBreakpointReceived) { // If it's already handled, nothing left to do if (loaderBreakpointReceived) { return; } // On x86, x64, we can just clear the exception. // This is even more complex on IA64, we have to actually skip it. IA64 is not yet implemented. // Loader Breakpoint is an exception event ExceptionNativeEvent e = nativeEvent as ExceptionNativeEvent; if (e == null) { return; } // and it's a breakpoint if (e.ExceptionCode != ExceptionCode.STATUS_BREAKPOINT) { return; } e.ContinueStatus = NativeMethods.ContinueStatus.DBG_CONTINUE; loaderBreakpointReceived = true; return; }
public void HandleLastChanceException(ExceptionNativeEvent em) { try { this.PyProcess.on_exception_last_chance((Int64)em.Address, (uint) em.ExceptionCode, em); } catch (Exception e) { _pyBoss.PrintError(e, string.Format("'Process' handler for instance '{0}' failed during attempt to call 'on_exception_last_chance()':", _name)); } }