// A helper method used to construct a new pending breakpoint. public void CreatePendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, out IDebugPendingBreakpoint2 ppPendingBP) { AD7PendingBreakpoint pendingBreakpoint = new AD7PendingBreakpoint(pBPRequest, _engine, this); ppPendingBP = (IDebugPendingBreakpoint2)pendingBreakpoint; _pendingBreakpoints.Add(pendingBreakpoint); }
/// <summary> /// Handle a modified breakpoint event. Only handles address changes. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void BreakpointModified(object sender, EventArgs args) { MICore.Debugger.ResultEventArgs res = args as MICore.Debugger.ResultEventArgs; MICore.ResultValue bkpt = res.Results.Find("bkpt"); string bkptId = null; // // =breakpoint-modified, // bkpt ={number="2",type="breakpoint",disp="keep",enabled="y",addr="<MULTIPLE>",times="0",original-location="main.cpp:220"}, // { number="2.1",enabled="y",addr="0x9c2149a9",func="Foo::bar<int>(int)",file="main.cpp",fullname="C:\\\\...\\\\main.cpp",line="220",thread-groups=["i1"]}, // { number="2.2",enabled="y",addr="0x9c2149f2",func="Foo::bar<float>(float)",file="main.cpp",fullname="C:\\\\...\\\\main.cpp",line="220",thread-groups=["i1"]} // note: the ".x" part of the breakpoint number never appears in stopping events, that is, when executing at one of these addresses // the stopping event delivered contains bkptno="2" if (bkpt is MICore.ValueListValue) { MICore.ValueListValue list = bkpt as MICore.ValueListValue; bkptId = list.Content[0].FindString("number"); // 0 is the "<MULTIPLE>" entry } else { bkptId = bkpt.FindString("number"); } AD7PendingBreakpoint pending = _pendingBreakpoints.Find((p) => { return(p.BreakpointId == bkptId); }); if (pending == null) { return; } var bindList = pending.PendingBreakpoint.BindAddresses(bkpt); RebindAddresses(pending, bindList); }
private AD7PendingBreakpoint BindToAddress(string bkptno, ulong addr, /*OPTIONAL*/ TupleValue frame, out AD7BoundBreakpoint bbp) { bbp = null; AD7PendingBreakpoint pending = CodeBreakpoints.FirstOrDefault((p) => { return(p.BreakpointId == bkptno); }); if (pending == null) { return(null); } // the breakpoint number is known, check to see if it is known to be bound to this address bbp = Array.Find(pending.EnumBoundBreakpoints(), (b) => b.Addr == addr); if (bbp == null) { // add this address as a bound breakpoint bbp = Array.Find(pending.EnumBoundBreakpoints(), (b) => b.Addr == 0); if (bbp != null) // <MULTIPLE> { bbp.UpdateAddr(addr); } else { bbp = pending.AddBoundBreakpoint(new BoundBreakpoint(pending.PendingBreakpoint, addr, frame)); } } return(pending); }
public AD7BoundBreakpoint(AD7Engine engine, AD7PendingBreakpoint pendingBreakpoint, AD7BreakpointResolution breakpointResolution, BoundBreakpoint bp) { _engine = engine; _pendingBreakpoint = pendingBreakpoint; _breakpointResolution = breakpointResolution; _deleted = false; _bp = bp; }
public AD7BoundBreakpoint(AD7Engine engine, AD7PendingBreakpoint pendingBreakpoint, AD7BreakpointResolution breakpointResolution, BoundBreakpoint bp) { _engine = engine; _pendingBreakpoint = pendingBreakpoint; _breakpointResolution = breakpointResolution; _deleted = false; _bp = bp; }
internal AD7PendingBreakpoint AddPendingBreakpoint(IDebugBreakpointRequest2 pBPRequest) { var bp = new AD7PendingBreakpoint(_engine, pBPRequest); lock (_pendingBreakpoints) _pendingBreakpoints.Add(bp); TryBindBreakpoints(); return(bp); }
public AD7BoundBreakpoint(AD7Engine engine, ulong address, AD7PendingBreakpoint pendingBreakpoint, AD7BreakpointResolution breakpointResolution, BoundBreakpoint bp) { _engine = engine; Addr = address; _pendingBreakpoint = pendingBreakpoint; _breakpointResolution = breakpointResolution; _enabled = true; _deleted = false; _bp = bp; }
public AD7BoundBreakpoint(AD7Engine engine, ulong address, AD7PendingBreakpoint pendingBreakpoint, AD7BreakpointResolution breakpointResolution, BoundBreakpoint bp) { _engine = engine; Addr = address; _pendingBreakpoint = pendingBreakpoint; _breakpointResolution = breakpointResolution; _enabled = true; _deleted = false; _bp = bp; }
private void RebindAddresses(AD7PendingBreakpoint pending, List<BoundBreakpoint> boundList) { if (boundList.Count == 0) { return; } var bkpt = Array.Find(pending.EnumBoundBreakpoints(), (b) => b.Addr == 0); int i = 0; if (bkpt != null) { bkpt.UpdateAddr(boundList[0].Addr); // replace <MULTIPLE> placeholder address i = 1; } for (; i < boundList.Count; ++i) { pending.AddBoundBreakpoint(boundList[i]); } }
private void RebindAddresses(AD7PendingBreakpoint pending, List <BoundBreakpoint> boundList) { if (boundList.Count == 0) { return; } var bkpt = Array.Find(pending.EnumBoundBreakpoints(), (b) => b.Addr == 0); int i = 0; if (bkpt != null) { bkpt.UpdateAddr(boundList[0].Addr); // replace <MULTIPLE> placeholder address i = 1; } for (; i < boundList.Count; ++i) { pending.AddBoundBreakpoint(boundList[i]); } }
private static BindResult EvalBindWatchResult(Results bindResult, AD7PendingBreakpoint pbreak, string address, uint size) { string errormsg = "Unknown error"; if (bindResult.ResultClass == ResultClass.error) { if (bindResult.Contains("msg")) { errormsg = bindResult.FindString("msg"); } if (String.IsNullOrWhiteSpace(errormsg)) { errormsg = "Unknown error"; } return(new BindResult(errormsg)); } else if (bindResult.ResultClass != ResultClass.done) { return(new BindResult(errormsg)); } TupleValue bkpt = null; if (bindResult.Contains("wpt")) { ResultValue b = bindResult.Find("wpt"); if (b is TupleValue) { bkpt = b as TupleValue; } } else { return(new BindResult(errormsg)); } string number = bkpt.FindString("number"); PendingBreakpoint bp = new PendingBreakpoint(pbreak, number, MIBreakpointState.Single); BoundBreakpoint bbp = new BoundBreakpoint(bp, MICore.Debugger.ParseAddr(address), size); return(new BindResult(bp, bbp)); }
internal static void GetILOffset(AD7PendingBreakpoint bp, MethodMirror methodMirror, out int ilOffset) { List<Mono.Debugger.Soft.Location> locations = methodMirror.Locations.ToList(); foreach (Mono.Debugger.Soft.Location location in locations) { int line = location.LineNumber; int column = location.ColumnNumber; if (line != bp.StartLine + 1) continue; //if (column != bp.StartColumn) // continue; ilOffset = location.ILOffset; Console.WriteLine(location.ColumnNumber); return; } throw new Exception("Cant bind breakpoint"); }
public AD7BoundBreakpoint FindHitBreakpoint(string bkptno, ulong addr, /*OPTIONAL*/ TupleValue frame, out bool fContinue) { fContinue = false; lock (_pendingBreakpoints) { AD7BoundBreakpoint bbp; AD7PendingBreakpoint pending = BindToAddress(bkptno, addr, frame, out bbp); if (pending == null) { return(null); } fContinue = true; if (!pending.Enabled || pending.Deleted || pending.PendingDelete) { return(null); } if (!bbp.Enabled || bbp.Deleted) { return(null); } fContinue = false; return(bbp); } }
internal void DeletePendingBreakpoint(AD7PendingBreakpoint breakPoint) { lock (_pendingBreakpoints) _pendingBreakpoints.Remove(breakPoint); }
internal static async Task <BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { string basename = System.IO.Path.GetFileName(documentName); // get basename from Windows path Results bindResult = await process.MICommandFactory.BreakInsert(process.EscapePath(basename), line, condition, ResultClass.None); string errormsg = "Unknown error"; if (bindResult.ResultClass == ResultClass.error) { if (bindResult.Contains("msg")) { errormsg = bindResult.FindString("msg"); } if (String.IsNullOrWhiteSpace(errormsg)) { errormsg = "Unknown error"; } return(new BindResult(errormsg)); } else if (bindResult.ResultClass != ResultClass.done) { return(new BindResult(errormsg)); } TupleValue bkpt = null; ValueListValue list = null; if (bindResult.Contains("bkpt")) { ResultValue b = bindResult.Find("bkpt"); if (b is TupleValue) { bkpt = b as TupleValue; } else if (b is ValueListValue) { // "<MULTIPLE>" sometimes includes a list of bound breakpoints list = b as ValueListValue; bkpt = list.Content[0] as TupleValue; } } else { // If the source file is not found, "done" is the result without a binding // (the error is sent via an "&" string and hence lost) return(new BindResult(errormsg)); } Debug.Assert(bkpt.FindString("type") == "breakpoint"); string number = bkpt.FindString("number"); string addr = bkpt.TryFindString("addr"); PendingBreakpoint bp = new PendingBreakpoint(pbreak, number, StringToBreakpointState(addr)); if (list == null) // single breakpoint { BoundBreakpoint bbp = bp.GetBoundBreakpoint(bkpt); if (bbp == null) { return(new BindResult(bp, MICoreResources.Status_BreakpointPending)); } return(new BindResult(bp, bbp)); } else // <MULTIPLE> with list of addresses { BindResult res = new BindResult(bp); for (int i = 1; i < list.Content.Length; ++i) { BoundBreakpoint bbp = bp.GetBoundBreakpoint(list.Content[i] as TupleValue); res.BoundBreakpoints.Add(bbp); } return(res); } }
internal static async Task <BindResult> Bind(string functionName, DebuggedProcess process, string condition, bool enabled, AD7PendingBreakpoint pbreak) { process.VerifyNotDebuggingCoreDump(); return(EvalBindResult(await process.MICommandFactory.BreakInsert(functionName, condition, enabled, ResultClass.None), pbreak)); }
internal PendingBreakpoint(AD7PendingBreakpoint pbreak, string number, MIBreakpointState state) { AD7breakpoint = pbreak; Number = number; _breakState = state; }
internal void BoundBreakpoint(AD7PendingBreakpoint breakpoint) { var iid = new Guid(AD7BreakpointBoundEvent.IID); _eventCallback.Event(_engine, _engine.RemoteProcess, _engine, null, new AD7BreakpointBoundEvent(breakpoint), ref iid, AD7AsynchronousEvent.Attributes); }
internal static async Task <BindResult> Bind(ulong codeAddress, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { process.VerifyNotDebuggingCoreDump(); return(EvalBindResult(await process.MICommandFactory.BreakInsert(codeAddress, condition, ResultClass.None), pbreak)); }
public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint) { _pendingBreakpoint = pendingBreakpoint; _boundBreakpoint = boundBreakpoint; }
private static BindResult EvalBindWatchResult(Results bindResult, AD7PendingBreakpoint pbreak, string address, uint size) { string errormsg = "Unknown error"; if (bindResult.ResultClass == ResultClass.error) { if (bindResult.Contains("msg")) { errormsg = bindResult.FindString("msg"); } if (String.IsNullOrWhiteSpace(errormsg)) { errormsg = "Unknown error"; } return new BindResult(errormsg); } else if (bindResult.ResultClass != ResultClass.done) { return new BindResult(errormsg); } TupleValue bkpt = null; if (bindResult.Contains("wpt")) { ResultValue b = bindResult.Find("wpt"); if (b is TupleValue) { bkpt = b as TupleValue; } } else { return new BindResult(errormsg); } string number = bkpt.FindString("number"); PendingBreakpoint bp = new PendingBreakpoint(pbreak, number, MIBreakpointState.Single); BoundBreakpoint bbp = new BoundBreakpoint(bp, MICore.Debugger.ParseAddr(address), size); return new BindResult(bp, bbp); }
internal static async Task<BindResult> Bind(string address, uint size, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { process.VerifyNotDebuggingCoreDump(); return EvalBindWatchResult(await process.MICommandFactory.BreakWatch(address, size, ResultClass.None), pbreak, address, size); }
public AD7BreakpointEvent(AD7PendingBreakpoint boundBreakpoints) { _boundBreakpoints = boundBreakpoints; }
internal AD7PendingBreakpoint AddPendingBreakpoint(IDebugBreakpointRequest2 pBPRequest) { var bp = new AD7PendingBreakpoint(_engine, pBPRequest); lock (_pendingBreakpoints) _pendingBreakpoints.Add(bp); TryBindBreakpoints(); return bp; }
internal static async Task <BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, bool enabled, IEnumerable <Checksum> checksums, AD7PendingBreakpoint pbreak) { process.VerifyNotDebuggingCoreDump(); string compilerSrcName; if (!process.MapCurrentSrcToCompileTimeSrc(documentName, out compilerSrcName)) { compilerSrcName = Path.GetFileName(documentName); } return(await EvalBindResult(await process.MICommandFactory.BreakInsert(compilerSrcName, process.UseUnixSymbolPaths, line, condition, enabled, checksums, ResultClass.None), pbreak)); }
// A helper method used to construct a new pending breakpoint. public void CreatePendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, out IDebugPendingBreakpoint2 ppPendingBP) { AD7PendingBreakpoint pendingBreakpoint = new AD7PendingBreakpoint(pBPRequest, _engine, this); ppPendingBP = (IDebugPendingBreakpoint2)pendingBreakpoint; lock (_pendingBreakpoints) { _pendingBreakpoints.Add(pendingBreakpoint); } }
internal PendingBreakpoint(AD7PendingBreakpoint pbreak, string number, MIBreakpointState state) { AD7breakpoint = pbreak; Number = number; _breakState = state; }
internal static async Task<BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { string basename = System.IO.Path.GetFileName(documentName); // get basename from Windows path Results bindResult = await process.MICommandFactory.BreakInsert(process.EscapePath(basename), line, condition, ResultClass.None); string errormsg = "Unknown error"; if (bindResult.ResultClass == ResultClass.error) { if (bindResult.Contains("msg")) { errormsg = bindResult.FindString("msg"); } if (String.IsNullOrWhiteSpace(errormsg)) { errormsg = "Unknown error"; } return new BindResult(errormsg); } else if (bindResult.ResultClass != ResultClass.done) { return new BindResult(errormsg); } TupleValue bkpt = null; ValueListValue list = null; if (bindResult.Contains("bkpt")) { ResultValue b = bindResult.Find("bkpt"); if (b is TupleValue) { bkpt = b as TupleValue; } else if (b is ValueListValue) { // "<MULTIPLE>" sometimes includes a list of bound breakpoints list = b as ValueListValue; bkpt = list.Content[0] as TupleValue; } } else { // If the source file is not found, "done" is the result without a binding // (the error is sent via an "&" string and hence lost) return new BindResult(errormsg); } Debug.Assert(bkpt.FindString("type") == "breakpoint"); string number = bkpt.FindString("number"); string addr = bkpt.TryFindString("addr"); PendingBreakpoint bp = new PendingBreakpoint(pbreak, number, StringToBreakpointState(addr)); if (list == null) // single breakpoint { BoundBreakpoint bbp = bp.GetBoundBreakpoint(bkpt); if (bbp == null) { return new BindResult(bp, MICoreResources.Status_BreakpointPending); } return new BindResult(bp, bbp); } else // <MULTIPLE> with list of addresses { BindResult res = new BindResult(bp); for (int i = 1; i < list.Content.Length; ++i) { BoundBreakpoint bbp = bp.GetBoundBreakpoint(list.Content[i] as TupleValue); res.BoundBreakpoints.Add(bbp); } return res; } }
internal static async Task<BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { string basename = System.IO.Path.GetFileName(documentName); // get basename from Windows path return EvalBindResult(await process.MICommandFactory.BreakInsert(process.EscapePath(basename), line, condition, ResultClass.None), pbreak); }
internal static async Task <BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, bool enabled, IEnumerable <Checksum> checksums, AD7PendingBreakpoint pbreak) { process.VerifyNotDebuggingCoreDump(); string compilerSrcName; if (!process.MapCurrentSrcToCompileTimeSrc(documentName, out compilerSrcName)) { compilerSrcName = Path.GetFileName(documentName); } BindResult bindResults = EvalBindResult(await process.MICommandFactory.BreakInsert(compilerSrcName, process.UseUnixSymbolPaths, line, condition, enabled, checksums, ResultClass.None), pbreak); // On GDB, the returned line information is from the pending breakpoint instead of the bound breakpoint. // Check the address mapping to make sure the line info is correct. if (process.MICommandFactory.Mode == MIMode.Gdb && bindResults.BoundBreakpoints != null) { foreach (var boundBreakpoint in bindResults.BoundBreakpoints) { string matchFile = compilerSrcName; if (!string.IsNullOrEmpty(boundBreakpoint.CompiledFileName)) { matchFile = boundBreakpoint.CompiledFileName; // get the file name as it appears in the symbolic info } boundBreakpoint.Line = await process.LineForStartAddress(matchFile, boundBreakpoint.Addr); } } return(bindResults); }
internal void BreakpointHit(AD7PendingBreakpoint breakpoint, AD7Thread thread) { var iid = new Guid(AD7BreakpointEvent.IID); _eventCallback.Event(_engine, _engine.RemoteProcess, _engine, thread, new AD7BreakpointEvent(breakpoint), ref iid, AD7StoppingEvent.Attributes); }
internal void DeletePendingBreakpoint(AD7PendingBreakpoint breakPoint) { lock (_pendingBreakpoints) _pendingBreakpoints.Remove(breakPoint); }
internal static async Task <BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { string basename = System.IO.Path.GetFileName(documentName); // get basename from Windows path return(EvalBindResult(await process.MICommandFactory.BreakInsert(process.EscapePath(basename), line, condition, ResultClass.None), pbreak)); }
public AD7ErrorBreakpoint(AD7PendingBreakpoint pending, string errormsg, enum_BP_ERROR_TYPE errorType = enum_BP_ERROR_TYPE.BPET_GENERAL_WARNING) { _pending = pending; _error = errormsg; _errorType = errorType; }
internal static async Task <BindResult> Bind(string functionName, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { return(EvalBindResult(await process.MICommandFactory.BreakInsert(functionName, condition, ResultClass.None), pbreak)); }
internal static async Task<BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { process.VerifyNotDebuggingCoreDump(); string basename = System.IO.Path.GetFileName(documentName); // get basename from Windows path basename = process.EscapePath(basename); BindResult bindResults = EvalBindResult(await process.MICommandFactory.BreakInsert(basename, line, condition, ResultClass.None), pbreak); // On GDB, the returned line information is from the pending breakpoint instead of the bound breakpoint. // Check the address mapping to make sure the line info is correct. if (process.MICommandFactory.Mode == MIMode.Gdb && bindResults.BoundBreakpoints != null) { foreach (var boundBreakpoint in bindResults.BoundBreakpoints) { boundBreakpoint.Line = await process.LineForStartAddress(basename, boundBreakpoint.Addr); } } return bindResults; }
public AD7BreakpointBoundEvent(AD7PendingBreakpoint pendingBreakpoint, AD7BoundBreakpoint boundBreakpoint) { _pendingBreakpoint = pendingBreakpoint; _boundBreakpoint = boundBreakpoint; }
internal static async Task<BindResult> Bind(ulong codeAddress, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { process.VerifyNotDebuggingCoreDump(); return EvalBindResult(await process.MICommandFactory.BreakInsert(codeAddress, condition, ResultClass.None), pbreak); }
internal static async Task <BindResult> Bind(string address, uint size, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { process.VerifyNotDebuggingCoreDump(); return(EvalBindWatchResult(await process.MICommandFactory.BreakWatch(address, size, ResultClass.None), pbreak, address, size)); }
public AD7ErrorBreakpoint(AD7PendingBreakpoint pending, string errormsg, enum_BP_ERROR_TYPE errorType = enum_BP_ERROR_TYPE.BPET_GENERAL_WARNING) { _pending = pending; _error = errormsg; _errorType = errorType; }
internal static async Task <BindResult> Bind(string documentName, uint line, uint column, DebuggedProcess process, string condition, bool enabled, IEnumerable <Checksum> checksums, AD7PendingBreakpoint pbreak) { process.VerifyNotDebuggingCoreDump(); string basename = System.IO.Path.GetFileName(documentName); // get basename from Windows path basename = process.EscapePath(basename); BindResult bindResults = EvalBindResult(await process.MICommandFactory.BreakInsert(basename, line, condition, enabled, checksums, ResultClass.None), pbreak); // On GDB, the returned line information is from the pending breakpoint instead of the bound breakpoint. // Check the address mapping to make sure the line info is correct. if (process.MICommandFactory.Mode == MIMode.Gdb && bindResults.BoundBreakpoints != null) { foreach (var boundBreakpoint in bindResults.BoundBreakpoints) { boundBreakpoint.Line = await process.LineForStartAddress(basename, boundBreakpoint.Addr); } } return(bindResults); }
internal static async Task<BindResult> Bind(string functionName, DebuggedProcess process, string condition, AD7PendingBreakpoint pbreak) { return EvalBindResult(await process.MICommandFactory.BreakInsert(functionName, condition, ResultClass.None), pbreak); }
private static BindResult EvalBindResult(Results bindResult, AD7PendingBreakpoint pbreak) { string errormsg = "Unknown error"; if (bindResult.ResultClass == ResultClass.error) { if (bindResult.Contains("msg")) { errormsg = bindResult.FindString("msg"); } if (String.IsNullOrWhiteSpace(errormsg)) { errormsg = "Unknown error"; } return(new BindResult(errormsg)); } else if (bindResult.ResultClass != ResultClass.done) { return(new BindResult(errormsg)); } TupleValue bkpt = null; ValueListValue list = null; if (bindResult.Contains("bkpt")) { ResultValue b = bindResult.Find("bkpt"); if (b is TupleValue) { bkpt = b as TupleValue; } else if (b is ValueListValue) { // "<MULTIPLE>" sometimes includes a list of bound breakpoints list = b as ValueListValue; bkpt = list.Content[0] as TupleValue; } } else { // If the source file is not found, "done" is the result without a binding // (the error is sent via an "&" string and hence lost) return(new BindResult(errormsg)); } Debug.Assert(bkpt.FindString("type") == "breakpoint"); string number = bkpt.FindString("number"); string warning = bkpt.TryFindString("warning"); string addr = bkpt.TryFindString("addr"); PendingBreakpoint bp; if (!string.IsNullOrEmpty(warning)) { Debug.Assert(string.IsNullOrEmpty(addr)); return(new BindResult(new PendingBreakpoint(pbreak, number, MIBreakpointState.Pending), warning)); } bp = new PendingBreakpoint(pbreak, number, StringToBreakpointState(addr)); if (list == null) // single breakpoint { BoundBreakpoint bbp = bp.GetBoundBreakpoint(bkpt); if (bbp == null) { return(new BindResult(bp, MICoreResources.Status_BreakpointPending)); } return(new BindResult(bp, bbp)); } else // <MULTIPLE> with list of addresses { BindResult res = new BindResult(bp); for (int i = 1; i < list.Content.Length; ++i) { BoundBreakpoint bbp = bp.GetBoundBreakpoint(list.Content[i] as TupleValue); res.BoundBreakpoints.Add(bbp); } return(res); } }
private static BindResult EvalBindResult(Results bindResult, AD7PendingBreakpoint pbreak) { string errormsg = "Unknown error"; if (bindResult.ResultClass == ResultClass.error) { if (bindResult.Contains("msg")) { errormsg = bindResult.FindString("msg"); } if (String.IsNullOrWhiteSpace(errormsg)) { errormsg = "Unknown error"; } return new BindResult(errormsg); } else if (bindResult.ResultClass != ResultClass.done) { return new BindResult(errormsg); } TupleValue bkpt = null; ValueListValue list = null; if (bindResult.Contains("bkpt")) { ResultValue b = bindResult.Find("bkpt"); if (b is TupleValue) { bkpt = b as TupleValue; } else if (b is ValueListValue) { // "<MULTIPLE>" sometimes includes a list of bound breakpoints list = b as ValueListValue; bkpt = list.Content[0] as TupleValue; } } else { // If the source file is not found, "done" is the result without a binding // (the error is sent via an "&" string and hence lost) return new BindResult(errormsg); } Debug.Assert(bkpt.FindString("type") == "breakpoint"); string number = bkpt.FindString("number"); string addr = bkpt.TryFindString("addr"); PendingBreakpoint bp = new PendingBreakpoint(pbreak, number, StringToBreakpointState(addr)); if (list == null) // single breakpoint { BoundBreakpoint bbp = bp.GetBoundBreakpoint(bkpt); if (bbp == null) { return new BindResult(bp, MICoreResources.Status_BreakpointPending); } return new BindResult(bp, bbp); } else // <MULTIPLE> with list of addresses { BindResult res = new BindResult(bp); for (int i = 1; i < list.Content.Length; ++i) { BoundBreakpoint bbp = bp.GetBoundBreakpoint(list.Content[i] as TupleValue); res.BoundBreakpoints.Add(bbp); } return res; } }
public AD7BreakpointEvent(AD7PendingBreakpoint boundBreakpoints) { _boundBreakpoints = boundBreakpoints; }