コード例 #1
0
ファイル: Program.cs プロジェクト: jpbruyere/netcoredbg
        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));
        }
コード例 #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));
        }
コード例 #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);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: wilvk/dotnet-sos
        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;
                }
            }
        }
コード例 #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);
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: viewizard/netcoredbg
        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();
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: viewizard/netcoredbg
        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();
        }
コード例 #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);
        }
コード例 #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);
        }