internal DbgBreakpointInfo(DbgEngDebugger debugger, DEBUG_BREAKPOINT_PARAMETERS nativeParams, WDebugBreakpoint db) : base(debugger) { m_nativeParams = nativeParams; m_debugControl = Debugger.ExecuteOnDbgEngThread(() => { return((WDebugControl)debugger.DebuggerInterface); }); __db = db; } // end constructor
public IList <BreakpointData> GetBreakpoints() { const uint DEBUG_ANY_ID = 0xffffffff; var count = GetBreakpointCount(); var retval = new List <BreakpointData>((int)count); if (count != 0) { var bps = new DEBUG_BREAKPOINT_PARAMETERS[count]; var res = _control5.GetBreakpointParameters(count, null, 0, bps); if (res != 0) { ErrorHelper.ThrowDebuggerException(res, "_control5.GetBreakpointParameters"); } foreach (var bp in bps.Where(bp => bp.Id != DEBUG_ANY_ID)) { IDebugBreakpoint2 bp2; res = _control5.GetBreakpointById2(bp.Id, out bp2); if (res != 0) { continue; } var command = GetCommand(bp2, bp.CommandSize); var offsetExpression = GetOffsetExpression(bp2, bp.OffsetExpressionSize); ulong offset; bp2.GetOffset(out offset); var p = bp; var k = (BreakType)p.BreakType; var flags = (BreakpointFlags)p.Flags; var dk = (DataBreakpointAccessTypes)p.DataAccessType; var bpd = new BreakpointData(p.Offset, k, flags, dk, p.DataSize, p.ProcType, p.MatchThread, p.Id, p.PassCount, p.CurrentPassCount, command, offsetExpression); retval.Add(bpd); } } return(retval); }
} // end constructor // N.B. Assumes we are on the dbgeng thread. internal void Refresh() { uint id; CheckHr(Bp.GetId(out id)); DEBUG_BREAKPOINT_PARAMETERS[] bpParams; uint[] ids = new uint[] { id }; int hr = m_debugControl.GetBreakpointParameters(ids, out bpParams); if (S_FALSE == hr) { // Uh-oh... breakpoint isn't valid anymore. MarkInvalid(); } else { CheckHr(hr); m_nativeParams = bpParams[0]; } } // end Refresh()
} // end Refresh() internal void RefreshNativeParams(DEBUG_BREAKPOINT_PARAMETERS newParams) { m_nativeParams = newParams; } // end RefreshNativeParams()
internal DbgBreakpointInfo(DbgEngDebugger debugger, DEBUG_BREAKPOINT_PARAMETERS nativeParams) : this(debugger, nativeParams, null) { }