public IList <BreakpointData> AddBreakpoints(BreakpointData data) { var ids = new List <uint>(); uint bpid; if (data.Expression != null) { var pattern = data.Expression; IList <SymbolSearchResult> matches = _symbols.GetMatchingSymbols(pattern); if (matches.Count == 0) { // do nothing } else { foreach (var match in matches) { bpid = AddBreakpointOffset(match.Offset, data); ids.Add(bpid); } } } else { bpid = AddBreakpointOffset(data.Offset, data); ids.Add(bpid); } var bps = GetBreakpoints(); return(bps.Where(bp => ids.Contains(bp.Id)).ToList()); }
public uint AddBreakpointOffset(ulong offset, BreakpointData data) { IDebugBreakpoint2 pBp; var res = _control5.AddBreakpoint2( (DEBUG_BREAKPOINT_TYPE)data.BreakType, data.Id, out pBp); if (res != 0) { ErrorHelper.ThrowDebuggerException(res, "IDebugControl5.AddBreakpoint2"); } pBp.SetOffset(offset); { pBp.SetCommandWide(data.Command); } if (data.PassCount != 0) { pBp.SetPassCount(data.PassCount); } if (data.MatchThread != 0) { pBp.SetMatchThreadId(data.MatchThread); } if (data.MatchThread != 0) { pBp.SetMatchThreadId(data.MatchThread); } if (data.BreakType == BreakType.Data) { pBp.SetDataParameters(data.DataSize, (DEBUG_BREAKPOINT_ACCESS_TYPE)data.DataBreakpointKind); } if (data.Flags != BreakpointFlags.None) { pBp.AddFlags((DEBUG_BREAKPOINT_FLAG)data.Flags); } uint newId; res = pBp.GetId(out newId); if (res != 0) { ErrorHelper.ThrowDebuggerException(res, "IDebugBreakpoint2.GetId"); } return(newId); }
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); }
public IList <BreakpointData> AddBreakpoints(BreakpointData data) { return(_proxy.AddBreakpoints(data)); }
public IList <BreakpointData> AddBreakpoints(BreakpointData data) { return(BreakpointManager.AddBreakpoints(data)); }