protected override GDBResponse <List <VariableObject> > Decode(string response)
        {
            var result = new GDBResponse <List <VariableObject> >(DecodeResponseCode(response));

            if (result.Response == ResponseCode.Done)
            {
                result.Value = new List <VariableObject>();

                var pairs = response.Substring(6).ToNameValuePairs();

                foreach (var pair in pairs)
                {
                    switch (pair.Name)
                    {
                    case "children":
                        var children = pair.Value.ToArray();

                        foreach (var child in children)
                        {
                            var childPair = child.ToNameValuePair();

                            result.Value.Add(childPair.Value.RemoveBraces().VariableObjectFromDataString(variable));
                        }

                        break;
                    }
                }
            }

            return(result);
        }
Example #2
0
        protected override GDBResponse <List <MemoryBytes> > Decode(string response)
        {
            var result = new GDBResponse <List <MemoryBytes> >(DecodeResponseCode(response));

            if (result.Response == ResponseCode.Done)
            {
                result.Value = response.MemoryBytesListFromDataString();
            }

            return(result);
        }
Example #3
0
        public async Task <List <VariableObjectChange> > UpdateVariablesAsync()
        {
            GDBResponse <List <VariableObjectChange> > response = null;

            response = await new VarUpdateCommand().Execute(this);

            if (response.Response == ResponseCode.Done)
            {
                return(response.Value);
            }
            return(null);
        }
Example #4
0
        public async Task <List <Frame> > ListStackFramesAsync()
        {
            GDBResponse <List <Frame> > result = null;

            await SafelyExecuteCommand(async() => { result = await new StackListFramesCommand().Execute(this); });

            if (result.Response == ResponseCode.Done)
            {
                return(result.Value);
            }
            return(null);
        }
Example #5
0
        public async Task <List <Variable> > ListStackVariablesAsync()
        {
            GDBResponse <List <Variable> > result = null;

            await SafelyExecuteCommand(async() => { result = await new StackListVariablesCommand().Execute(this); });

            if (result != null)
            {
                return(result.Value);
            }
            return(null);
        }
        protected override GDBResponse <List <string> > Decode(string response)
        {
            var result = new GDBResponse <List <string> >(DecodeResponseCode(response));

            if (result.Response == ResponseCode.Done)
            {
                var parseString = response.Substring(21).RemoveBraces().Replace("\"", string.Empty);

                result.Value = parseString.Split(',').ToList();
            }

            return(result);
        }
Example #7
0
        protected override GDBResponse <List <int> > Decode(string response)
        {
            var result = new GDBResponse <List <int> >(DecodeResponseCode(response));

            if (result.Response == ResponseCode.Done)
            {
                result.Value = new List <int>();

                foreach (var s in response.Substring(24).ToArray())
                {
                    result.Value.Add(Convert.ToInt32(s.RemoveBraces()));
                }
            }

            return(result);
        }
Example #8
0
        protected override GDBResponse <List <InstructionLine> > Decode(string response)
        {
            var result = new GDBResponse <List <InstructionLine> >(DecodeResponseCode(response));

            if (result.Response == ResponseCode.Done)
            {
                result.Value = new List <InstructionLine>();

                var lines = response.Substring(16).ToArray();

                foreach (var line in lines)
                {
                    result.Value.AddRange(line.InstructionLineListFromDataString());
                }
            }

            return(result);
        }
Example #9
0
        protected override GDBResponse <List <Frame> > Decode(string response)
        {
            var result = new GDBResponse <List <Frame> >(DecodeResponseCode(response));

            if (result.Response == ResponseCode.Done)
            {
                var data = response.Substring(12, response.Length - 12).ToArray();

                result.Value = new List <Frame>();

                foreach (var obj in data)
                {
                    result.Value.Add(Frame.FromDataString(obj.Substring(6, obj.Length - 6)));
                }
            }

            return(result);
        }
        protected override GDBResponse <List <Variable> > Decode(string response)
        {
            if (response != string.Empty)
            {
                var result = new GDBResponse <List <Variable> >(DecodeResponseCode(response));

                if (result.Response == ResponseCode.Done)
                {
                    var data = response.Substring(16, response.Length - 16).ToArray();

                    result.Value = new List <Variable>();

                    foreach (var obj in data)
                    {
                        result.Value.Add(obj.RemoveBraces().VariableFromDataString());
                    }
                }

                return(result);
            }
            return(null);
        }
Example #11
0
        protected override GDBResponse <List <VariableObjectChange> > Decode(string response)
        {
            var result = new GDBResponse <List <VariableObjectChange> >(DecodeResponseCode(response));

            if (result.Response == ResponseCode.Done)
            {
                result.Value = new List <VariableObjectChange>();

                var pair = response.Substring(6).ToNameValuePair();

                if (pair.Name == "changelist")
                {
                    var changes = pair.Value.ToArray();

                    foreach (var change in changes)
                    {
                        result.Value.Add(VariableObjectChange.FromDataString(change.RemoveBraces()));
                    }
                }
            }

            return(result);
        }
Example #12
0
        protected override GDBResponse <List <Tuple <int, string> > > Decode(string response)
        {
            var result = new GDBResponse <List <Tuple <int, string> > >(DecodeResponseCode(response));

            if (result.Response == ResponseCode.Done)
            {
                result.Value = new List <Tuple <int, string> >();

                var registerValues = response.Substring(22).ToArray();

                foreach (var registerValue in registerValues)
                {
                    var pairs = registerValue.RemoveBraces().ToNameValuePairs();

                    var num = -1;
                    var val = string.Empty;

                    foreach (var pair in pairs)
                    {
                        switch (pair.Name)
                        {
                        case "number":
                            num = Convert.ToInt32(pair.Value);
                            break;

                        case "value":
                            val = pair.Value;
                            break;
                        }
                    }

                    result.Value.Add(new Tuple <int, string>(num, val));
                }
            }

            return(result);
        }