private IDebugBreakpoint2 SetBreakpoint(UInt64 address, DEBUG_BREAKPOINT_TYPE breakpointType, DEBUG_BREAKPOINT_ACCESS_TYPE access, UInt32 size) { const UInt32 AnyId = UInt32.MaxValue; IDebugBreakpoint2 breakpoint = null; this.BeginInterrupt(); Task.Factory.StartNew(() => { try { this.CheckHandleResult(this.Control.AddBreakpoint2(breakpointType, AnyId, out breakpoint)); breakpoint.SetOffset(address); breakpoint.SetFlags(DEBUG_BREAKPOINT_FLAG.ENABLED); breakpoint.SetDataParameters(size, access); this.Control.SetExecutionStatus(DEBUG_STATUS.GO); } catch (Exception ex) { Logger.Log(LogLevel.Error, "Error setting breakpoint", ex); } }, CancellationToken.None, TaskCreationOptions.DenyChildAttach, this.Scheduler.ExclusiveScheduler).Wait(); this.EndInterrupt(); return(breakpoint); }
public Breakpoint CreateBreakpoint(DEBUG_BREAKPOINT_TYPE type, uint id = uint.MaxValue) { return(RunAsync(() => { IDebugBreakpoint bp; Control.AddBreakpoint(type, id, out bp).ThrowIfFailed(); return new Breakpoint(this, (IDebugBreakpoint3)bp); }).Result); }