Ejemplo 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;
 }
Ejemplo n.º 2
0
 internal JThread(JProcess process, long identity, bool isWorkerThread)
 {
     _process = process;
     _identity = identity;
     _isWorkerThread = isWorkerThread;
     _name = "";
 }
Ejemplo n.º 3
0
        public static void RegisterProcess(Guid id, JProcess process)
        {
            lock (_targets) {
                EnsureListenerSocket();

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

            EnsureConnected();
        }
Ejemplo 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;
 }
Ejemplo 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;
     }
 }
Ejemplo 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));
         }
     }
 }
Ejemplo 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();
            }
        }
Ejemplo 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;
        }