当前位置: 首页>>代码示例>>C#>>正文


C# Results.Find方法代码示例

本文整理汇总了C#中Results.Find方法的典型用法代码示例。如果您正苦于以下问题:C# Results.Find方法的具体用法?C# Results.Find怎么用?C# Results.Find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Results的用法示例。


在下文中一共展示了Results.Find方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
            }
        }
开发者ID:orestst,项目名称:MIEngine,代码行数:68,代码来源:Breakpoints.cs

示例2: 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);
        }
开发者ID:yeaicc,项目名称:MIEngine,代码行数:39,代码来源:Breakpoints.cs


注:本文中的Results.Find方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。