Esempio n. 1
0
        private DebugCallStack ParseCallStackIntoObjectForm(string callStackFromEngine, string errorMessage)
        {
            DebugCallStack result = new DebugCallStack(errorMessage);

            string[] callStackLines = callStackFromEngine.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string callStackEntry in callStackLines)
            {
                // There's a  (and more...)  if the call stack is too long, ignore it
                int firstSpeechMark = callStackEntry.IndexOf('"');
                if (firstSpeechMark >= 0)
                {
                    string callStack      = callStackEntry.Substring(firstSpeechMark + 1);
                    string scriptName     = callStack.Substring(0, callStack.IndexOf('"'));
                    string lineNumberText = callStack.Substring(callStack.IndexOf('"'));
                    lineNumberText = lineNumberText.Substring(lineNumberText.IndexOf("line ") + 5);
                    int i = 0;
                    while ((i < lineNumberText.Length) &&
                           (Char.IsDigit(lineNumberText, i)))
                    {
                        i++;
                    }
                    lineNumberText = lineNumberText.Substring(0, i);
                    result.AddLine(scriptName, Convert.ToInt32(lineNumberText));
                }
            }
            return(result);
        }
Esempio n. 2
0
 private DebugCallStack ParseCallStackIntoObjectForm(string callStackFromEngine, string errorMessage)
 {
     DebugCallStack result = new DebugCallStack(errorMessage);
     string[] callStackLines = callStackFromEngine.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
     foreach (string callStackEntry in callStackLines)
     {
         // There's a  (and more...)  if the call stack is too long, ignore it
         int firstSpeechMark = callStackEntry.IndexOf('"');
         if (firstSpeechMark >= 0)
         {
             string callStack = callStackEntry.Substring(firstSpeechMark + 1);
             string scriptName = callStack.Substring(0, callStack.IndexOf('"'));
             string lineNumberText = callStack.Substring(callStack.IndexOf('"'));
             lineNumberText = lineNumberText.Substring(lineNumberText.IndexOf("line ") + 5);
             int i = 0;
             while ((i < lineNumberText.Length) &&
                    (Char.IsDigit(lineNumberText, i)))
             {
                 i++;
             }
             lineNumberText = lineNumberText.Substring(0, i);
             result.AddLine(scriptName, Convert.ToInt32(lineNumberText));
         }
     }
     return result;
 }
Esempio n. 3
0
 private void _debugger_BreakAtLocation(DebugCallStack callStack)
 {
     Factory.GUIController.HideOutputPanel();
     Factory.GUIController.ShowCallStack(callStack);
     Factory.GUIController.ZoomToFile(callStack.Lines[0].ScriptName, callStack.Lines[0].LineNumber, true, callStack.ErrorMessage);
 }
Esempio n. 4
0
        public void ShowCallStack(DebugCallStack callStack)
        {
            if (_mainForm.pnlCallStack.InvokeRequired)
            {
                _mainForm.pnlCallStack.Invoke(new ShowCallStackDelegate(ShowCallStack), callStack);
                return;
            }

            _mainForm.pnlCallStack.CallStack = callStack;
            _mainForm.pnlCallStack.Show();
        }