Esempio n. 1
0
 public static void myOutputDebugStringA(DebugStatus status, string info1, string info2)
 {
     if (status == DebugStatus.debug)
     {
         Win32API.OutputDebugStringA(string.Format("{0},{1}", info1, info2));
     }
 }
Esempio n. 2
0
        //构造函数
        public designerDebugTracking(WorkflowDesigner designer)
        {
            //(1)
            this.designer     = designer;
            this.debugService = designer.DebugManagerView as DebuggerService;;

            //ziyunhx 2013-8-8 add debug status
            DebugStatus debug = new DebugStatus();

            debug.status = 1;

            //(2) TrackingProfile
            TrackingProfile    trackingProfile    = new TrackingProfile();
            ActivityStateQuery activityStateQuery = new ActivityStateQuery()
            {
                ActivityName = "*",
                States       = { ActivityStates.Executing },
                Variables    = { "*" },
                Arguments    = { "*" }
            };

            trackingProfile.Queries.Add(activityStateQuery);

            this.TrackingProfile = trackingProfile;

            //(3)
            clearTrackInfo();

            //(4)
            sourceLocationList = getSourceLocationMap();
            activityMapList    = getActivityMapList(sourceLocationList);
        } //end
Esempio n. 3
0
 public void WriteLine(string Text, DebugStatus State)
 {
     try
     {
         richTextBox1.SelectionStart = richTextBox1.Text.Length;
         switch (State)
         {
             case DebugStatus.None:
                 richTextBox1.SelectionColor = Color.Black;
                 break;
             case DebugStatus.Cool:
                 richTextBox1.SelectionColor = Color.Green;
                 break;
             case DebugStatus.Error:
                 richTextBox1.SelectionColor = Color.Red;
                 break;
             case DebugStatus.Warning:
                 richTextBox1.SelectionColor = Color.Yellow;
                 break;
         }
         richTextBox1.SelectedText = Text + "\n";
         richTextBox1.SelectionColor = Color.Green;
         richTextBox1.ScrollToCaret();
     }
     catch
     {
     }
 }
Esempio n. 4
0
        public void WriteLine(string Text, DebugStatus State)
        {
            try
            {
                richTextBox1.SelectionStart = richTextBox1.Text.Length;
                switch (State)
                {
                case DebugStatus.None:
                    richTextBox1.SelectionColor = Color.Black;
                    break;

                case DebugStatus.Cool:
                    richTextBox1.SelectionColor = Color.Green;
                    break;

                case DebugStatus.Error:
                    richTextBox1.SelectionColor = Color.Red;
                    break;

                case DebugStatus.Warning:
                    richTextBox1.SelectionColor = Color.Yellow;
                    break;
                }
                richTextBox1.SelectedText   = Text + "\n";
                richTextBox1.SelectionColor = Color.Green;
                richTextBox1.ScrollToCaret();
            }
            catch
            {
            }
        }
Esempio n. 5
0
        protected override void Execute(CodeActivityContext context)
        {
            try
            {
                Guid FlowInstranceID = context.WorkflowInstanceId;
                DebugStatus debug = new DebugStatus();
                if (debug.status == 0)
                {
                    string result = s.Get(context);

                    if (result == "true")
                    {
                        //TODO Change the step.
                        //BLL.Document.DocumentEndStep(FlowInstranceID, "1");
                    }
                    else
                    {
                        //BLL.Document.DocumentEndStep(FlowInstranceID, "2");
                    }
                }
            }
            catch//(Exception e)
            {
                //执行出错
            }
        }
Esempio n. 6
0
 public static void WriteSeparateLine(object sender, DebugStatus status)
 {
     var handler = DebugRised;
     if (handler != null)
     {
         handler(sender, new DebugArg("==========================", status));
     }
 }
Esempio n. 7
0
 public static void WriteLine(object sender, string line, DebugStatus status)
 {
     var handler = DebugRised;
     if (handler != null)
     {
         handler(sender, new DebugArg(line, status));
     }
 }
Esempio n. 8
0
        public static void WriteLine(object Sender, string Line, DebugStatus Status)
        {
            EventHandler <DebugArg> handler = DebugRised;

            if (handler != null)
            {
                handler(Sender, new DebugArg(Line, Status));
            }
        }
Esempio n. 9
0
        public static void WriteLine(object sender, string line, DebugStatus status)
        {
            var handler = DebugRised;

            if (handler != null)
            {
                handler(sender, new DebugArg(line, status));
            }
        }
Esempio n. 10
0
        public static void WriteSeparateLine(object sender, DebugStatus status)
        {
            var handler = DebugRised;

            if (handler != null)
            {
                handler(sender, new DebugArg("==========================", status));
            }
        }
Esempio n. 11
0
        public static void WriteSeparateLine(object Sender, DebugStatus Status)
        {
            EventHandler <DebugArg> handler = DebugRised;

            if (handler != null)
            {
                handler(Sender, new DebugArg("==========================", Status));
            }
        }
Esempio n. 12
0
 private void OnDebugStatus(string status)
 {
     if (DebugStatus != null)
     {
         DebugStatus.BeginInvoke(this, new DeviceDebugEventArgs()
         {
             DebugStatus = status
         },
                                 null, null);
     }
 }
 void WriteDebugLine(string Text, DebugStatus State)
 {
     if (!this.InvokeRequired)
     {
         this.WriteLine(Text, State);
     }
     else
     {
         this.Invoke(new WriteDebugLineDelegate(WriteLine), new object[] { Text, State });
     }
 }
        public void SetDebugStatus(DebugStatus debugStatus)
        {
            if (debugStatus == DebugStatus.Finished)
            {
                CommandManager.InvalidateRequerySuggested();
            }

            if (debugStatus == DebugStatus.Configure)
            {
                DebugOutputViewModel.Clear();
            }

            DebugOutputViewModel.DebugStatus = debugStatus;
        }
Esempio n. 15
0
 public void logToGooglePlay()
 {
     if (Social.localUser.authenticated)
     {
         Application.LoadLevel(1);
     }
     else
     {
         Social.localUser.Authenticate((bool success) =>
         {
             if (success)
             {
                 DebugStatus.changeStatus("Login Failed");
                 Application.LoadLevel(1);
             }
             else
             {
                 DebugStatus.changeStatus("Login Failed");
             }
         });
     }
 }
Esempio n. 16
0
        public async Task Run()
        {
            this.didShutdown = false;
            bool isRestarting = false;

            System.EventHandler <EngineStateChangeEventArgs> engineStateChanged = (object sender, EngineStateChangeEventArgs args) => {
                if (args.Change == EngineStateChange.EffectiveProcessor)
                {
                    Processor processorType = (Processor)args.Argument;
                    this.engine.IsPointer64Bit = (processorType == Processor.Amd64) || (processorType == Processor.Arm64);
                }
                else if (args.Change == EngineStateChange.ExecutionStatus)
                {
                    bool        insideWait      = (args.Argument & (ulong)DebugStatus.InsideWait) == (ulong)DebugStatus.InsideWait;
                    DebugStatus executionStatus = (DebugStatus)(args.Argument & (~(ulong)DebugStatus.InsideWait));
                    if (executionStatus == DebugStatus.RestartTarget)
                    {
                        isRestarting = true;
                    }
                    else if (executionStatus == DebugStatus.NoDebuggee)
                    {
                        this.engine.NotifyDebuggerStatusChange(DebuggerChangeEventArgs.DebuggerStatus.Detaching);
                        this.engine.DiaLoader.ClearSymbols();
                        if (isRestarting)
                        {
                            isRestarting = false;
                        }
                        else
                        {
                            Task shutdownTask = this.Shutdown();
                        }
                    }
                    else if (executionStatus == DebugStatus.Break)
                    {
                        if (!insideWait)
                        {
                            this.engine.NotifyDebuggerStatusChange(DebuggerChangeEventArgs.DebuggerStatus.Break);
                        }
                    }
                }
            };

            this.client.EngineStateChanged += engineStateChanged;

            while (!this.isShuttingDown)
            {
                try {
                    uint currentProcessSystemId = await this.AttemptOperation <uint>(() => this.systemObjects.CurrentProcessSystemId, String.Format("Unable to retrieve the current process system ID."));

                    uint currentThreadSystemId = await this.AttemptOperation <uint>(() => this.systemObjects.CurrentThreadSystemId, String.Format("Unable to retrieve the current thread system ID."));

                    if (this.TargetProcessSystemId == 0)
                    {
                        this.TargetProcessSystemId = currentProcessSystemId;
                        if (this.TargetProcessSystemId != 0)
                        {
                            this.engine.NotifyDebuggerStatusChange(DebuggerChangeEventArgs.DebuggerStatus.ChangingProcess);
                        }
                    }
                    else if (this.TargetProcessSystemId != currentProcessSystemId)
                    {
                        this.TargetProcessSystemId = currentProcessSystemId;
                        this.engine.NotifyDebuggerStatusChange(DebuggerChangeEventArgs.DebuggerStatus.ChangingProcess);
                    }
                    else if (this.TargetThreadSystemId != currentThreadSystemId)
                    {
                        this.TargetThreadSystemId = currentThreadSystemId;
                        this.engine.NotifyDebuggerStatusChange(DebuggerChangeEventArgs.DebuggerStatus.ChangingThread);
                    }

                    this.client.DispatchCallbacks(TimeSpan.Zero);
                    await Task.Delay(100);
                } catch (Exception ex) {
                    Console.Out.WriteLine("Shutting down due to exception: {0}", ex.Message);
                    Task shutdownTask = this.Shutdown();
                }
            }

            try {
                this.client.DispatchCallbacks(TimeSpan.Zero);
                this.client.EngineStateChanged -= engineStateChanged;
            } finally {
                this.isShuttingDown = false;
                this.didShutdown    = true;
            }
        }
Esempio n. 17
0
 public DebugArg(string line, DebugStatus status)
 {
     _debugLine = line;
     _status = status;
 }
Esempio n. 18
0
 public void RunToCursor()
 {
     try
     {
         //cur_brpt = dbg.AddBreakpoint(new SourcecodeSegment((frm.CurrentTabPage.ag as CodeFileDocumentControl).FileName,(frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Line + 1,(frm.CurrentTabPage.Tag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column + 1,
           //  (frm.CurrentTabPage.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.Caret.Column+100), true);
         workbench.WidgetController.SetStartDebugDisabled();
         currentBreakpoint = dbg.AddBreakpoint(WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.FileName, WorkbenchServiceFactory.DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Caret.Line + 1);
         AddGoToBreakPoint(currentBreakpoint);
         Status = DebugStatus.None;
         dbg.Processes[0].Continue();
         //dbg.RemoveBreakpoint(cur_brpt);
         CurrentLineBookmark.Remove();
     }
     catch (System.Exception e)
     {
     }
 }
Esempio n. 19
0
 void debugProcessExit(object sender, ProcessEventArgs e)
 {
     if (Exited != null && ExeFileName != null)
         Exited(ExeFileName);
     curPage = null;            
     show_debug_tabs = true;
     workbench.WidgetController.SetPlayButtonsVisible(false);
     workbench.WidgetController.SetAddExprMenuVisible(false);
     DebugWatchListWindowForm.WatchWindow.ClearAllSubTrees();
     IsRunning = false;
     workbench.WidgetController.SetDebugStopDisabled();
     workbench.WidgetController.ChangeContinueDebugNameOnStart();
     //if (cur_brpt != null) dbg.RemoveBreakpoint(cur_brpt);
     CurrentLineBookmark.Remove();
     WorkbenchServiceFactory.DebuggerOperationsService.ClearLocalVarTree();
     WorkbenchServiceFactory.DebuggerOperationsService.ClearDebugTabs();
     WorkbenchServiceFactory.DebuggerOperationsService.ClearWatch();
     workbench.WidgetController.SetDebugTabsVisible(false);
     WorkbenchServiceFactory.OperationsService.ClearTabStack();
     workbench.WidgetController.EnableCodeCompletionToolTips(true);
     RemoveGotoBreakpoints();
     AssemblyHelper.Unload();
     CloseOldToolTip();
     //RemoveMarker(frm.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Document);
     evaluator = null;
     parser= null;
     FileName = null;
     handle = 0;
     ExeFileName = null;
     FullFileName = null;
     PrevFullFileName = null;
     Status = DebugStatus.None;
     dbg.ProcessStarted -= debugProcessStarted;
     dbg.ProcessExited -= debugProcessExit;
     dbg.BreakpointHit -= debugBreakpointHit;
     debuggedProcess = null;
     //GC.Collect();
     //dbg = null;
 }
Esempio n. 20
0
 public DebugArg(string Line, DebugStatus Status)
 {
     _DebugLine = Line;
     _Status    = Status;
 }
Esempio n. 21
0
 public DebugArg(string line, DebugStatus status)
 {
     _debugLine = line;
     _status    = status;
 }