Esempio n. 1
0
        public static VariablesResponse GetLocalVariables(Int64 frameId)
        {
            int variablesReference = Context.GetVariablesReference(frameId, "Locals");

            VariablesRequest variablesRequest = new VariablesRequest();

            variablesRequest.arguments.variablesReference = variablesReference;
            var ret = VSCodeDebugger.Request(variablesRequest);

            Assert.True(ret.Success);

            return(JsonConvert.DeserializeObject <VariablesResponse>(ret.ResponseStr));
        }
Esempio n. 2
0
        public VariablesResponse GetLocalVariables(string caller_trace, Int64 frameId)
        {
            int variablesReference = GetVariablesReference(@"__FILE__:__LINE__" + "\n" + caller_trace, frameId, "Locals");

            VariablesRequest variablesRequest = new VariablesRequest();

            variablesRequest.arguments.variablesReference = variablesReference;
            var ret = VSCodeDebugger.Request(variablesRequest);

            Assert.True(ret.Success, @"__FILE__:__LINE__" + "\n" + caller_trace);

            return(JsonConvert.DeserializeObject <VariablesResponse>(ret.ResponseStr));
        }
Esempio n. 3
0
        public int GetChildVariablesReference(string caller_trace, int VariablesReference, string VariableName)
        {
            VariablesRequest variablesRequest = new VariablesRequest();

            variablesRequest.arguments.variablesReference = VariablesReference;
            var ret = VSCodeDebugger.Request(variablesRequest);

            Assert.True(ret.Success, @"__FILE__:__LINE__" + "\n" + caller_trace);

            VariablesResponse variablesResponse =
                JsonConvert.DeserializeObject <VariablesResponse>(ret.ResponseStr);

            foreach (var Variable in variablesResponse.body.variables)
            {
                if (Variable.name == VariableName)
                {
                    return(Variable.variablesReference);
                }
            }

            throw new ResultNotSuccessException(@"__FILE__:__LINE__" + "\n" + caller_trace);
        }
Esempio n. 4
0
        public static void EvalVariable(int variablesReference, string Type, string Name, string Value)
        {
            VariablesRequest variablesRequest = new VariablesRequest();

            variablesRequest.arguments.variablesReference = variablesReference;
            var ret = VSCodeDebugger.Request(variablesRequest);

            Assert.True(ret.Success);

            VariablesResponse variablesResponse =
                JsonConvert.DeserializeObject <VariablesResponse>(ret.ResponseStr);

            foreach (var Variable in variablesResponse.body.variables)
            {
                if (Variable.name == Name)
                {
                    Assert.True(Type == Variable.type &&
                                Value == Variable.value);
                    return;
                }
            }
        }
Esempio n. 5
0
        public void EvalVariableByIndex(string caller_trace, int variablesReference, string Type, int Index, string Value)
        {
            VariablesRequest variablesRequest = new VariablesRequest();

            variablesRequest.arguments.variablesReference = variablesReference;
            var ret = VSCodeDebugger.Request(variablesRequest);

            Assert.True(ret.Success, @"__FILE__:__LINE__" + "\n" + caller_trace);

            VariablesResponse variablesResponse =
                JsonConvert.DeserializeObject <VariablesResponse>(ret.ResponseStr);

            if (Index < variablesResponse.body.variables.Count)
            {
                var Variable = variablesResponse.body.variables[Index];
                Assert.Equal(Type, Variable.type, @"__FILE__:__LINE__" + "\n" + caller_trace);
                Assert.Equal(Value, Variable.value, @"__FILE__:__LINE__" + "\n" + caller_trace);
                return;
            }

            throw new ResultNotSuccessException(@"__FILE__:__LINE__" + "\n" + caller_trace);
        }
Esempio n. 6
0
        public static void EvalVariableByIndex(int variablesReference, string Type, int Index, string Value)
        {
            VariablesRequest variablesRequest = new VariablesRequest();

            variablesRequest.arguments.variablesReference = variablesReference;
            var ret = VSCodeDebugger.Request(variablesRequest);

            Assert.True(ret.Success);

            VariablesResponse variablesResponse =
                JsonConvert.DeserializeObject <VariablesResponse>(ret.ResponseStr);

            if (Index < variablesResponse.body.variables.Count)
            {
                var Variable = variablesResponse.body.variables[Index];
                Assert.True(Type == Variable.type &&
                            Value == Variable.value);
                return;
            }

            throw new NetcoreDbgTestCore.ResultNotSuccessException();
        }
Esempio n. 7
0
        public static int GetChildVariablesReference(int VariablesReference, string VariableName)
        {
            VariablesRequest variablesRequest = new VariablesRequest();

            variablesRequest.arguments.variablesReference = VariablesReference;
            var ret = VSCodeDebugger.Request(variablesRequest);

            Assert.True(ret.Success);

            VariablesResponse variablesResponse =
                JsonConvert.DeserializeObject <VariablesResponse>(ret.ResponseStr);

            foreach (var Variable in variablesResponse.body.variables)
            {
                if (Variable.name == VariableName)
                {
                    return(Variable.variablesReference);
                }
            }

            throw new NetcoreDbgTestCore.ResultNotSuccessException();
        }
Esempio n. 8
0
        public bool EvalVariable(string caller_trace, int variablesReference, string ExpectedResult, string ExpectedType, string VariableName)
        {
            VariablesRequest variablesRequest = new VariablesRequest();

            variablesRequest.arguments.variablesReference = variablesReference;
            var ret = VSCodeDebugger.Request(variablesRequest);

            Assert.True(ret.Success, @"__FILE__:__LINE__" + "\n" + caller_trace);

            VariablesResponse variablesResponse =
                JsonConvert.DeserializeObject <VariablesResponse>(ret.ResponseStr);

            foreach (var Variable in variablesResponse.body.variables)
            {
                if (Variable.name == VariableName)
                {
                    Assert.Equal(ExpectedType, Variable.type, @"__FILE__:__LINE__" + "\n" + caller_trace);
                    Assert.Equal(ExpectedResult, Variable.value, @"__FILE__:__LINE__" + "\n" + caller_trace);
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 9
0
        public void EvalVariable(string caller_trace, int variablesReference, string Type, string Name, string Value)
        {
            VariablesRequest variablesRequest = new VariablesRequest();

            variablesRequest.arguments.variablesReference = variablesReference;
            var ret = VSCodeDebugger.Request(variablesRequest);

            Assert.True(ret.Success, @"__FILE__:__LINE__" + "\n" + caller_trace);

            VariablesResponse variablesResponse =
                JsonConvert.DeserializeObject <VariablesResponse>(ret.ResponseStr);

            foreach (var Variable in variablesResponse.body.variables)
            {
                if (Variable.name == Name)
                {
                    Assert.Equal(Type, Variable.type, @"__FILE__:__LINE__" + "\n" + caller_trace);
                    Assert.Equal(Value, Variable.value, @"__FILE__:__LINE__" + "\n" + caller_trace);
                    return;
                }
            }

            throw new ResultNotSuccessException(@"__FILE__:__LINE__" + "\n" + caller_trace);
        }