コード例 #1
0
def symbolize(output, source_dir_path):
    """Symbolize a stacktrace."""
    output = output.strip()
    if not output:
        # If no input, nothing to symbolize. Bail out, otherwise
        # we hang inside symbolizer.
        return ''

    asan_symbolizer_location = os.path.join(
        source_dir_path,
        os.path.join('tools', 'valgrind', 'asan', 'asan_symbolize.py'))
    symbolizer_proxy_location = common.get_resource(0755,
                                                    'asan_symbolize_proxy.py')

    _, symbolized_out = common.execute(
        asan_symbolizer_location,
        '',
        os.path.expanduser('~'),
        env={
            'LLVM_SYMBOLIZER_PATH': symbolizer_proxy_location,
            'CHROMIUM_SRC': source_dir_path
        },
        capture_output=True,
        exit_on_error=True,
        stdout_transformer=output_transformer.Identity(),
        stdin=common.StringStdin(output + '\0'),
        redirect_stderr_to_stdout=True)
    logger.info(symbolized_out)
    return symbolized_out
コード例 #2
0
    def test_stdin(self):
        """Test input is a string."""
        stdin = common.StringStdin('some input')

        with open(stdin.stdin.name) as f:
            self.assertEqual('some input', f.read())
        self.assertEqual('some input', stdin.get().read())
        self.assertEqual('cmd < %s' % stdin.stdin.name,
                         stdin.update_cmd_log('cmd'))
コード例 #3
0
 def gclient_sync(self):
   """Run gclient sync. This is separated from install_deps because it is
     needed in every build."""
   common.execute(
       'gclient', 'sync', self.get_source_dir_path(),
       # gclient sync sometimes asks a yes/no question (e.g. installing
       # Android SDK).
       stdin=common.StringStdin('y\ny\ny\n'),
   )