Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Unified Diff: sky/tools/mojo_cache_linker.py

Issue 788903011: Move to using build-ids to tell GDB about libraries Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Updated to tip of tree Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | sky/tools/skydb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/mojo_cache_linker.py
diff --git a/sky/tools/mojo_cache_linker.py b/sky/tools/mojo_cache_linker.py
deleted file mode 100755
index 4592eba39a476177e66f4b9573a84dd2307639b9..0000000000000000000000000000000000000000
--- a/sky/tools/mojo_cache_linker.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import argparse
-import logging
-import os
-import re
-import sys
-
-# TODO(eseidel): This should be shared with tools/android_stack_parser/stack
-# TODO(eseidel): This could be replaced by using build-ids on Android
-# TODO(eseidel): mojo_shell should write out a cache mapping file.
-def main():
- logging.basicConfig(level=logging.INFO)
- parser = argparse.ArgumentParser(
- description='Watches mojo_shell logcat output and builds a directory '
- 'of symlinks to symboled binaries for seen cache names.')
- parser.add_argument('links_dir', type=str)
- parser.add_argument('symbols_dir', type=str)
- parser.add_argument('base_url', type=str)
- args = parser.parse_args()
-
- regex = re.compile('Caching mojo app (?P<url>\S+) at (?P<path>\S+)')
-
- if not os.path.isdir(args.links_dir):
- logging.fatal('links_dir: %s is not a directory' % args.links_dir)
- sys.exit(1)
-
- for line in sys.stdin:
- result = regex.search(line)
- if not result:
- continue
-
- url = result.group('url')
- if not url.startswith(args.base_url):
- logging.debug('%s does not match base %s' % (url, args.base_url))
- continue
- full_name = os.path.basename(url)
- name, ext = os.path.splitext(full_name)
- if ext != '.mojo':
- logging.debug('%s is not a .mojo library' % url)
- continue
-
- symboled_name = 'lib%s_library.so' % name
- cache_link_path = os.path.join(args.links_dir,
- os.path.basename(result.group('path')))
- symboled_path = os.path.realpath(
- os.path.join(args.symbols_dir, symboled_name))
- if not os.path.isfile(symboled_path):
- logging.warn('symboled path %s does not exist' % symboled_path)
- continue
-
- print "%s -> %s" % (cache_link_path, symboled_path)
-
- if os.path.lexists(cache_link_path):
- logging.debug('link already exists %s, replacing' % symboled_path)
- os.unlink(cache_link_path)
-
- os.symlink(symboled_path, cache_link_path)
-
-if __name__ == '__main__':
- main()
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | sky/tools/skydb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698