private void FindWhatAccesses(ProjectItem projectItem) { if (projectItem is AddressItem) { this.CancelTrace(); this.Results.Clear(); AddressItem addressItem = projectItem as AddressItem; BreakpointSize size = Debugger.Default.SizeToBreakpointSize((UInt32)Conversions.SizeOf(addressItem.DataType)); this.DebuggerCancellationTokenSource = Debugger.Default.FindWhatAccesses(addressItem.CalculatedAddress, size, this.CodeTraceEvent); } }
public CancellationTokenSource FindWhatAccesses(UInt64 address, BreakpointSize size, MemoryAccessCallback callback) { this.Attach(); this.accessCancellationToken?.Cancel(); this.EventCallBacks.AccessCallback = callback; IDebugBreakpoint2 breakpoint = this.SetHardwareBreakpoint(address, DEBUG_BREAKPOINT_ACCESS_TYPE.READ | DEBUG_BREAKPOINT_ACCESS_TYPE.WRITE, size.ToUInt32()); if (breakpoint == null) { return(null); } this.accessCancellationToken = this.CreateNewCancellationToken(this.OnAccessTraceCancel); this.BreakPoints.TryAdd(this.accessCancellationToken, breakpoint); return(this.accessCancellationToken); }
public static UInt32 ToUInt32(this BreakpointSize breakPointSize) { switch (breakPointSize) { case BreakpointSize.B1: return(1); case BreakpointSize.B2: return(2); case BreakpointSize.B4: return(4); case BreakpointSize.B8: return(8); default: throw new ArgumentException("Invalid breakpoint size enumeration value"); } }