本文整理汇总了C#中Results.Contains方法的典型用法代码示例。如果您正苦于以下问题:C# Results.Contains方法的具体用法?C# Results.Contains怎么用?C# Results.Contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Results
的用法示例。
在下文中一共展示了Results.Contains方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EvalBindResult
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;
}
}
示例2: OnStopped
private async void OnStopped(Results results)
{
string reason = results.TryFindString("reason");
if (reason.StartsWith("exited") || reason.StartsWith("disconnected"))
{
if (this.ProcessState != ProcessState.Exited)
{
this.ProcessState = ProcessState.Exited;
if (ProcessExitEvent != null)
{
ProcessExitEvent(this, new ResultEventArgs(results));
}
}
return;
}
//if this is an exception reported from LLDB, it will not currently contain a frame object in the MI
//if we don't have a frame, check if this is an exception and retrieve the frame
if (!results.Contains("frame") &&
(string.Compare(reason, "exception-received", StringComparison.OrdinalIgnoreCase) == 0 ||
string.Compare(reason, "signal-received", StringComparison.OrdinalIgnoreCase) == 0)
)
{
//get the info for the current frame
Results frameResult = await MICommandFactory.StackInfoFrame();
//add the frame to the stopping results
results = results.Add("frame", frameResult.Find("frame"));
}
bool fIsAsyncBreak = MICommandFactory.IsAsyncBreakSignal(results);
if (await DoInternalBreakActions(fIsAsyncBreak))
{
return;
}
this.ProcessState = ProcessState.Stopped;
FlushBreakStateData();
if (!results.Contains("frame"))
{
if (ModuleLoadEvent != null)
{
ModuleLoadEvent(this, new ResultEventArgs(results));
}
}
else if (BreakModeEvent != null)
{
BreakRequest request = _requestingRealAsyncBreak;
_requestingRealAsyncBreak = BreakRequest.None;
BreakModeEvent(this, new StoppingEventArgs(results, request));
}
}
示例3: EvalBindWatchResult
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);
}
示例4: OnStopped
private async void OnStopped(Results results)
{
string reason = results.TryFindString("reason");
if (reason.StartsWith("exited"))
{
string threadGroupId = results.TryFindString("id");
if (!String.IsNullOrEmpty(threadGroupId))
{
lock (_debuggeePids)
{
_debuggeePids.Remove(threadGroupId);
}
}
if (IsLocalGdbAttach())
{
CmdExitAsync();
}
this.ProcessState = ProcessState.Exited;
if (ProcessExitEvent != null)
{
ProcessExitEvent(this, new ResultEventArgs(results));
}
return;
}
//if this is an exception reported from LLDB, it will not currently contain a frame object in the MI
//if we don't have a frame, check if this is an excpetion and retrieve the frame
if (!results.Contains("frame") &&
string.Compare(reason, "exception-received", StringComparison.OrdinalIgnoreCase) == 0
)
{
//get the info for the current frame
Results frameResult = await MICommandFactory.StackInfoFrame();
//add the frame to the stopping results
results.Add("frame", frameResult.Find("frame"));
}
bool fIsAsyncBreak = MICommandFactory.IsAsyncBreakSignal(results);
if (await DoInternalBreakActions(fIsAsyncBreak))
{
return;
}
this.ProcessState = ProcessState.Stopped;
FlushBreakStateData();
if (!results.Contains("frame"))
{
if (ModuleLoadEvent != null)
{
ModuleLoadEvent(this, new ResultEventArgs(results));
}
}
else if (BreakModeEvent != null)
{
if (fIsAsyncBreak) { _requestingRealAsyncBreak = false; }
BreakModeEvent(this, new ResultEventArgs(results));
}
}