Exemplo n.º 1
0
        private void HandleEnumChildren(Stream stream)
        {
            int execId = stream.ReadInt32();
            ChildrenInfo completion;

            lock (_pendingChildEnums) {
                completion = _pendingChildEnums[execId];
                _pendingChildEnums.Remove(execId);
            }

            int attributesCount = stream.ReadInt32();
            int indicesCount = stream.ReadInt32();
            bool indicesAreIndex = stream.ReadInt32() == 1;
            bool indicesAreEnumerate = stream.ReadInt32() == 1;
            JEvaluationResult[] res = new JEvaluationResult[attributesCount + indicesCount];
            for (int i = 0; i < attributesCount; i++) {
                string expr = stream.ReadString();
                res[i] = ReadJObject(stream, completion.Text, expr, false, false, completion.Frame);
            }
            for (int i = attributesCount; i < res.Length; i++) {
                string expr = stream.ReadString();
                res[i] = ReadJObject(stream, completion.Text, expr, indicesAreIndex, indicesAreEnumerate, completion.Frame);
            }
            completion.Completion(res);
        }
Exemplo n.º 2
0
 internal void SetVariables(JEvaluationResult[] variables)
 {
     _variables = variables;
 }
Exemplo n.º 3
0
        private void HandleThreadFrameList(Stream stream)
        {
            // list of thread frames
            var frames = new List<JStackFrame>();
            long tid = stream.ReadInt64();
            JThread thread;
            _threads.TryGetValue(tid, out thread);
            var threadName = stream.ReadString();

            int frameCount = stream.ReadInt32();
            for (int i = 0; i < frameCount; i++) {
                int startLine = stream.ReadInt32();
                int endLine = stream.ReadInt32();
                int lineNo = stream.ReadInt32();
                string frameName = stream.ReadString();
                string filename = stream.ReadString();
                int argCount = stream.ReadInt32();
                var frameKind = (FrameKind)stream.ReadInt32();
                JStackFrame frame = null;
                if (thread != null) {
                    switch (frameKind) {
                        case FrameKind.Django:
                            string sourceFile = stream.ReadString();
                            var sourceLine = stream.ReadInt32();
                            frame = new DjangoStackFrame(thread, frameName, filename, startLine, endLine, lineNo, argCount, i, sourceFile, sourceLine);
                            break;
                        default:
                            frame = new JStackFrame(thread, frameName, filename, startLine, endLine, lineNo, argCount, i, frameKind);
                            break;
                    }

                }

                int varCount = stream.ReadInt32();
                JEvaluationResult[] variables = new JEvaluationResult[varCount];
                for (int j = 0; j < variables.Length; j++) {
                    string name = stream.ReadString();
                    if (frame != null) {
                        variables[j] = ReadJObject(stream, name, "", false, false, frame);
                    }
                }
                if (frame != null) {
                    frame.SetVariables(variables);
                    frames.Add(frame);
                }
            }

            Debug.WriteLine("Received frames for thread {0}", tid);
            if (thread != null) {
                thread.Frames = frames;
                if (threadName != null) {
                    thread.Name = threadName;
                }
            }
        }