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


C# Results.FindInt方法代码示例

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


在下文中一共展示了Results.FindInt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Stopped

        public async Task<bool> Stopped(Results results, int tid)
        {
            string reason = results.TryFindString("reason");
            ThreadProgress s = StateFromTid(tid);

            if (reason == "fork")
            {
                s = new ThreadProgress();
                s.State = State.AtFork;
                s.Newpid = results.FindInt("newpid");
                _threadStates[tid] = s;
                await _process.Step(tid, VisualStudio.Debugger.Interop.enum_STEPKIND.STEP_OUT, VisualStudio.Debugger.Interop.enum_STEPUNIT.STEP_LINE);
                return true;
            }
            else if (reason == "vfork")
            {
                s = new ThreadProgress();
                s.State = State.AtVfork;
                s.Newpid = results.FindInt("newpid");
                _threadStates[tid] = s;
                await _process.MICommandFactory.SetOption("schedule-multiple", "on");
                await _process.MICommandFactory.Catch("exec", onlyOnce: true);
                var thread = await _process.ThreadCache.GetThread(tid);
                await _process.Continue(thread);
                return true;
            }

            if (s == null)
            {
                return false;   // no activity being tracked on this thread
            }

            switch (s.State)
            {
                case State.AtFork:
                    await ProcessChild(s);
                    break;
                case State.AtVfork:
                    await _process.MICommandFactory.SetOption("schedule-multiple", "off");
                    if ("exec" == results.TryFindString("reason"))
                    {
                        // The process doesn't handle the SIGSTOP correctly (just ignores it) when the process is at the start of program 
                        // (after exec). Let it run some code so that it will correctly respond to the SIGSTOP.
                        s.Exe = results.TryFindString("new-exec");
                        await RunChildToMain(s);
                    }
                    else
                    {
                        // sometimes gdb misses the breakpoint at exec and execution will proceed to a breakpoint in the child
                        _process.Logger.WriteLine("Missed catching the exec after vfork. Spawning the child's debugger.");
                        s.State = State.AtExec;
                        goto missedExec;
                    }
                    break;
                case State.AtSignal:    // both child and parent are stopped
                    s.State = State.Complete;
                    return await DetachAndContinue(s);
                case State.AtExec:
                missedExec:
                    if (tid == s.Newtid)    // stopped in the child
                    {
                        await ProcessChild(s);
                    }
                    else // sometime the parent will get a spurious signal before the child hits main
                    {
                        await ContinueTheChild(s);
                    }
                    break;
                case State.Complete:
                    _threadStates.Remove(tid);
                    if (reason == "signal-received" && results.TryFindString("signal-name") == "SIGSTOP")
                    {
                        // SIGSTOP was propagated to the parent
                        await _process.MICommandFactory.Signal("SIGCONT");
                        return true;
                    }
                    return false;
                default:
                    return false;
            }
            return true;
        }
开发者ID:rajkumar42,项目名称:MIEngine,代码行数:82,代码来源:DebugUnixChildProcess.cs

示例2: ThreadCreatedEvent

 public void ThreadCreatedEvent(Results evnt)
 {
     int tid = evnt.FindInt("id");
     string groupId = evnt.FindString("group-id");
     int pid = _process.PidByInferior(groupId);
     foreach (var p in _threadStates)
     {
         if (p.Value.Newpid == pid)
         {
             p.Value.Newtid = tid;
         }
     }
 }
开发者ID:rajkumar42,项目名称:MIEngine,代码行数:13,代码来源:DebugUnixChildProcess.cs


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