def run(self, args): sys.path.append( os.path.join(self.sdk_path(args), 'Pebble', 'common', 'tools')) self.add_arm_tools_to_path(args) paths = [] if args.elf_path is None: try: with open('appinfo.json', 'r') as f: app_info = json.load(f) for platform in app_info['targetPlatforms']: paths.append('build/{}/pebble-app.elf'.format(platform)) except IOError: raise Exception( "Unable to read targetPlatforms from appinfo.json. Please specify a valid elf path." ) else: paths.append(args.elf_path) 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)
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)
def run(self, args): sys.path.append(os.path.join(self.sdk_path(args), 'Pebble', 'common', 'tools')) self.add_arm_tools_to_path(args) paths = [] if args.elf_path is None: try: with open('appinfo.json', 'r') as f: app_info = json.load(f) for platform in app_info['targetPlatforms']: paths.append('build/{}/pebble-app.elf'.format(platform)) except IOError: raise Exception("Unable to read targetPlatforms from appinfo.json. Please specify a valid elf path.") else: paths.append(args.elf_path) 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)