Esempio n. 1
0
    def _get_responses_list(self, raw_output, stream, verbose):
        """Get parsed response list from string output
        Args:
            raw_output (unicode): gdb output to parse
            stream (str): either stdout or stderr
            verbose (bool): add verbose output when true
        """
        responses = []

        raw_output, self._incomplete_output[
            stream] = _buffer_incomplete_responses(
                raw_output, self._incomplete_output.get(stream))

        if not raw_output:
            return responses

        response_list = list(
            filter(lambda x: x,
                   raw_output.decode().split('\n')))  # remove blank lines

        # parse each response from gdb into a dict, and store in a list
        for response in response_list:
            if gdbmiparser.response_is_finished(response):
                pass
            else:
                parsed_response = gdbmiparser.parse_response(response)
                parsed_response['stream'] = stream

                responses.append(parsed_response)
                if verbose:
                    pprint(parsed_response)

        return responses
Esempio n. 2
0
    def _get_responses_list(self, raw_output, stream):
        """Get parsed response list from string output
        Args:
            raw_output (unicode): gdb output to parse
            stream (str): either stdout or stderr
        """
        responses = []

        raw_output, self._incomplete_output[stream] = _buffer_incomplete_responses(
            raw_output, self._incomplete_output.get(stream)
        )

        if not raw_output:
            return responses

        response_list = list(
            filter(lambda x: x, raw_output.decode(errors="replace").split("\n"))
        )  # remove blank lines

        # parse each response from gdb into a dict, and store in a list
        for response in response_list:
            if gdbmiparser.response_is_finished(response):
                pass
            else:
                parsed_response = gdbmiparser.parse_response(response)
                parsed_response["stream"] = stream

                self.logger.debug("%s", pformat(parsed_response))

                responses.append(parsed_response)

        return responses
Esempio n. 3
0
    def _get_responses_list(self, raw_output, stream, verbose):
        """Get parsed response list from string output
        Args:
            raw_output (unicode): gdb output to parse
            stream (str): either stdout or stderr
            verbose (bool): add verbose output when true
        """
        responses = []
        if not raw_output:
            return responses

        stripped_raw_response_list = [
            x.strip() for x in raw_output.decode().split('\n')
        ]
        raw_response_list = list(
            filter(lambda x: x, stripped_raw_response_list))
        raw_response_list, self._buffer = _buffer_incomplete_responses(
            raw_response_list, self._buffer)

        # parse each response from gdb and put into a list
        for response in raw_response_list:
            if gdbmiparser.response_is_finished(response):
                pass
            else:
                parsed_response = gdbmiparser.parse_response(response)
                parsed_response['stream'] = stream

                responses.append(parsed_response)
                if verbose:
                    pprint(parsed_response)
        return responses