コード例 #1
0
ファイル: DalvikProcess.cs プロジェクト: yuva2achieve/dot42
        /// <summary>
        /// Perform a single step on the given thread.
        /// </summary>
        public Task StepAsync(StepRequest request)
        {
            // Set event
            lastStepRequest = request;
            var thread  = request.Thread;
            var setTask = debugger.EventRequest.SetAsync(Jdwp.EventKind.SingleStep, Jdwp.SuspendPolicy.All, new EventStepModifier(thread.Id, Jdwp.StepSize.Line, request.StepDepth));

            return(setTask.ContinueWith(t => {
                t.ForwardException();
                // Record step
                StepManager.Add(new DalvikStep(thread, t.Result));
                // Resume execution
                return debugger.VirtualMachine.ResumeAsync().ContinueWith(x => OnResumed());
            }).Unwrap());
        }
コード例 #2
0
ファイル: add-step.aspx.cs プロジェクト: dinhquang94/questcan
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            StepManager SM   = new StepManager();
            StepTBx     step = new StepTBx();


            step.status = 1;
            step.effect = Request["effect"];

            StepTBx temp = SM.GetbyStepnumber(int.Parse(Request["number"]));
            if (temp != null)
            {
                Response.Write(JsonConvert.SerializeObject(new
                {
                    success = 0,
                    error   = "Step was has Effect"
                }));
                return;
            }
            step.step_number = int.Parse(Request["number"]);
            SM.Add(step);
            Response.Write(JsonConvert.SerializeObject(new
            {
                success = 1
            }));
        }
        catch (Exception ex)
        {
            Response.Write(JsonConvert.SerializeObject(new
            {
                success = -1,
                error   = ex
            }));
        }
    }