scripts/profile-symbolicate.py
def Locate(self):
    """Try to determine the local name of a given library"""
    if self.target_name[:7] == "/system":
      basename = os.path.basename(self.target_name)
      # First look for a gecko library. We avoid the dist tree since
      # those are stripped.
      if "GECKO_OBJDIR" in os.environ:
        gecko_objdir = os.environ["GECKO_OBJDIR"]
      else:
        gecko_objdir = "objdir-gecko"
      if not os.path.isdir(gecko_objdir):
        print(gecko_objdir, "isn't a directory");
        sys.exit(1)
      lib_name = self.FindLibInTree(basename, gecko_objdir, exclude_dir="dist")
      if not lib_name:
        # Probably an android library
        if "PRODUCT_OUT" in os.environ:
          product_out = os.environ["PRODUCT_OUT"] + "/symbols"
        else:
          product_out = "out/target/product"
        if not os.path.isdir(product_out):
          print(product_out, "isn't a directory");
          sys.exit(1)
        lib_name = self.FindLibInTree(basename, product_out)
      if lib_name:
        self.host_name = lib_name
        if self.verbose:
          print "Found '" + self.host_name + "' for '" + self.target_name + "'"
    elif self.target_name in gSpecialLibs:
      self.symbol_table = gSpecialLibs[self.target_name]
      self.symbol_table_addresses = sorted(self.symbol_table.keys())
    elif self.target_name[:1] == "/": # Absolute paths.
      basename = os.path.basename(self.target_name)
      dirname = os.path.dirname(self.target_name)
      lib_name = self.target_name
      if os.path.exists(lib_name):
        self.target_name = basename
        self.host_name = lib_name
        if self.verbose:
          print "Found '" + self.host_name + "' for '" + self.target_name + "'"
    self.located = True
Try to determine the local name of a given library
Try to determine the local name of a given library
Try to determine the local name of a given library
def Locate(self):
    if self.target_name[:7] == "/system":
      basename = os.path.basename(self.target_name)
      if "GECKO_OBJDIR" in os.environ:
        gecko_objdir = os.environ["GECKO_OBJDIR"]
      else:
        gecko_objdir = "objdir-gecko"
      if not os.path.isdir(gecko_objdir):
        print(gecko_objdir, "isn't a directory");
        sys.exit(1)
      lib_name = self.FindLibInTree(basename, gecko_objdir, exclude_dir="dist")
      if not lib_name:
        if "PRODUCT_OUT" in os.environ:
          product_out = os.environ["PRODUCT_OUT"] + "/symbols"
        else:
          product_out = "out/target/product"
        if not os.path.isdir(product_out):
          print(product_out, "isn't a directory");
          sys.exit(1)
        lib_name = self.FindLibInTree(basename, product_out)
      if lib_name:
        self.host_name = lib_name
        if self.verbose:
          print "Found '" + self.host_name + "' for '" + self.target_name + "'"
    elif self.target_name in gSpecialLibs:
      self.symbol_table = gSpecialLibs[self.target_name]
      self.symbol_table_addresses = sorted(self.symbol_table.keys())
    elif self.target_name[:1] == "/": 
      basename = os.path.basename(self.target_name)
      dirname = os.path.dirname(self.target_name)
      lib_name = self.target_name
      if os.path.exists(lib_name):
        self.target_name = basename
        self.host_name = lib_name
        if self.verbose:
          print "Found '" + self.host_name + "' for '" + self.target_name + "'"
    self.located = True
def Locate ( self ) : if self . target_name [ : 7 ] == "/system" : basename = os . path . basename ( self . target_name ) if "GECKO_OBJDIR" in os . environ : gecko_objdir = os . environ [ "GECKO_OBJDIR" ] else : gecko_objdir = "objdir-gecko" if not os . path . isdir ( gecko_objdir ) : print ( gecko_objdir , "isn't a directory" ) ; sys . exit ( 1 ) lib_name = self . FindLibInTree ( basename , gecko_objdir , exclude_dir = "dist" ) if not lib_name : if "PRODUCT_OUT" in os . environ : product_out = os . environ [ "PRODUCT_OUT" ] + "/symbols" else : product_out = "out/target/product" if not os . path . isdir ( product_out ) : print ( product_out , "isn't a directory" ) ; sys . exit ( 1 ) lib_name = self . FindLibInTree ( basename , product_out ) if lib_name : self . host_name = lib_name if self . verbose : print "Found '" + self . host_name + "' for '" + self . target_name + "'" elif self . target_name in gSpecialLibs : self . symbol_table = gSpecialLibs [ self . target_name ] self . symbol_table_addresses = sorted ( self . symbol_table . keys ( ) ) elif self . target_name [ : 1 ] == "/" : basename = os . path . basename ( self . target_name ) dirname = os . path . dirname ( self . target_name ) lib_name = self . target_name if os . path . exists ( lib_name ) : self . target_name = basename self . host_name = lib_name if self . verbose : print "Found '" + self . host_name + "' for '" + self . target_name + "'" self . located = True
Try to determine the local name of a given library
Try to determine the local name of a given library
"""Try to determine the local name of a given library""" # First look for a gecko library. We avoid the dist tree since # those are stripped. # Probably an android library # Absolute paths.
self