コード例 #1
0
    def __call__(self, args):
        BaseCommand.__call__(self, args)
        self.add_arm_tools_to_path()
        sys.path.append(os.path.join(sdk_path(), 'pebble', 'common', 'tools'))

        paths = []
        if args.elf_path is None:
            try:
                project = PebbleProject()
                paths = ['build/{}/pebble-app.elf'.format(x) for x in project.target_platforms]
            except PebbleProjectException:
                raise ToolError("This is not a valid Pebble project. Please instead specify a valid elf path.")
            except Exception as e:
                print(e)
        else:
            paths.append(args.elf_path)

        # This is Super Special Magic of some form that comes from the SDK.
        import binutils

        for path in paths:
            print("\n======{}======".format(path))
            sections = binutils.analyze_elf(path, 'bdt', use_fast_nm=True)

            for s in sections.itervalues():
                s.pprint(args.summary, args.verbose)
コード例 #2
0
ファイル: __init__.py プロジェクト: ad1217/pebble-tool
 def get_sdk_path(self):
     path = sdk_manager.path_for_sdk(self.sdk) if self.sdk is not None else sdk_path()
     logger.debug("SDK path: %s", path)
     if not os.path.exists(os.path.join(path, "pebble", "waf")):
         raise MissingSDK("SDK unavailable; can't run this command.")
     return path
コード例 #3
0
 def get_sdk_path(self):
     path = sdk_manager.path_for_sdk(self.sdk) if self.sdk is not None else sdk_path()
     logger.debug("SDK path: %s", path)
     if not os.path.exists(os.path.join(path, 'pebble', 'waf')):
         raise MissingSDK("SDK unavailable; can't run this command.")
     return path
コード例 #4
0
ファイル: __init__.py プロジェクト: mcclellanmj/pebble-tool
 def get_sdk_path(self):
     path = sdk_path()
     if not os.path.exists(os.path.join(path, "Pebble", "waf")):
         raise MissingSDK("SDK unavailable; can't run this command.")
     return path
コード例 #5
0
ファイル: analytics.py プロジェクト: mcclellanmj/pebble-tool
 def get_option_dir(cls):
     try:
         return os.path.normpath(os.path.join(sdk_path(), '..'))
     except MissingSDK:
         return get_persist_dir()