Esempio n. 1
0
 /// <summary>
 /// Creates a JObject for an expression which raised an exception instead of returning a value.
 /// </summary>
 public JEvaluationResult(JProcess process, string exceptionText, string expression, JStackFrame frame)
 {
     _process = process;
     _expression = expression;
     _frame = frame;
     _exceptionText = exceptionText;
 }
Esempio n. 2
0
 internal JThread(JProcess process, long identity, bool isWorkerThread)
 {
     _process = process;
     _identity = identity;
     _isWorkerThread = isWorkerThread;
     _name = "";
 }
Esempio n. 3
0
        public static void RegisterProcess(Guid id, JProcess process)
        {
            lock (_targets) {
                EnsureListenerSocket();

                _targets[id] = new WeakReference(process);
            }
        }
Esempio n. 4
0
        public JDebugProcessReplEvaluator(JProcess process)
        {
            _process = process;
            _threadId = process.GetThreads()[0].Id;
            _languageVersion = process.LanguageVersion;

            EnsureConnected();
        }
Esempio n. 5
0
 /// <summary>
 /// Creates a JObject for an expression which successfully returned a value.
 /// </summary>
 public JEvaluationResult(JProcess process, string objRepr, string hexRepr, string typeName, string expression, string childText, bool childIsIndex, bool childIsEnumerate, JStackFrame frame, bool isExpandable)
 {
     _process = process;
     _expression = expression;
     _frame = frame;
     _objRepr = objRepr;
     _hexRepr = hexRepr;
     _typeName = typeName;
     _isExpandable = isExpandable;
     _childText = childText;
     _childIsIndex = childIsIndex;
     _childIsEnumerate = childIsEnumerate;
 }
Esempio n. 6
0
 public static ConnErrorMessages TryAttach(int pid, out JProcess process)
 {
     try {
         process = new JProcess(pid);
         return ConnErrorMessages.None;
     } catch (AttachException ex) {
         process = null;
         return ex.Error;
     }
 }
Esempio n. 7
0
 internal void SwitchProcess(JProcess process, bool verbose)
 {
     var newEvaluator = _evaluators[process.Id];
     if (newEvaluator != _activeEvaluator) {
         _activeEvaluator = newEvaluator;
         ActiveProcessChanged();
         if (verbose) {
             _window.WriteLine(String.Format("Current process changed to {0}", process.Id));
         }
     }
 }
Esempio n. 8
0
        internal void DetachProcess(JProcess process)
        {
            int id = process.Id;
            JDebugProcessReplEvaluator evaluator;
            if (_evaluators.TryGetValue(id, out evaluator)) {
                evaluator.AvailableScopesChanged -= new EventHandler<EventArgs>(evaluator_AvailableScopesChanged);
                evaluator.MultipleScopeSupportChanged -= new EventHandler<EventArgs>(evaluator_MultipleScopeSupportChanged);
                process.DisconnectRepl();
                _evaluators.Remove(id);
                if (_activeEvaluator == evaluator) {
                    _activeEvaluator = null;
                }

                ActiveProcessChanged();
            }
        }
Esempio n. 9
0
        internal void AttachProcess(JProcess process)
        {
            if (_evaluators.ContainsKey(process.Id)) {
                // Process is already attached, so just switch to it if needed
                SwitchProcess(process, false);
                return;
            }

            process.ProcessExited += new EventHandler<ProcessExitedEventArgs>(OnProcessExited);
            var evaluator = new JDebugProcessReplEvaluator(process);
            evaluator.Window = _window;
            evaluator.AvailableScopesChanged += new EventHandler<EventArgs>(evaluator_AvailableScopesChanged);
            evaluator.MultipleScopeSupportChanged += new EventHandler<EventArgs>(evaluator_MultipleScopeSupportChanged);
            _evaluators.Add(process.Id, evaluator);

            _activeEvaluator = evaluator;
        }