tools/cygprofile/process_profiles.py
def GetDumpOffsetToSymbolInfo(self):
    """Computes an array mapping each word in .text to a symbol.

    Returns:
      [symbol_extractor.SymbolInfo or None] For every 4 bytes of the .text
        section, maps it to a symbol, or None.
    """
    if self._offset_to_symbol_info is None:
      start_syms = [s for s in self.SymbolInfos()
                    if s.name == symbol_extractor.START_OF_TEXT_SYMBOL]
      assert len(start_syms) == 1, 'Can\'t find unique start of text symbol'
      start_of_text = start_syms[0].offset
      max_offset = max(s.offset + s.size for s in self.SymbolInfos())
      text_length_halfwords = (max_offset - start_of_text) // 2
      self._offset_to_symbol_info = [None] * text_length_halfwords
      for sym in self.SymbolInfos():
        offset = sym.offset - start_of_text
        assert offset >= 0, ('Unexpected symbol before the start of text. '
                             'Has the linker script broken?')
        # The low bit of offset may be set to indicate a thumb instruction. The
        # actual offset is still halfword aligned and so the low bit may be
        # safely ignored in the division by two below.
        for i in range(offset // 2, (offset + sym.size) // 2):
          assert i < text_length_halfwords
          other_symbol = self._offset_to_symbol_info[i]
          # There may be overlapping symbols, for example fancy
          # implementations for __ltsf2 and __gtsf2 (merging common tail
          # code). In this case, keep the one that started first.
          if other_symbol is None or other_symbol.offset > sym.offset:
            self._offset_to_symbol_info[i] = sym

        if sym.name != symbol_extractor.START_OF_TEXT_SYMBOL and sym.size == 0:
          idx = offset // 2
          assert (self._offset_to_symbol_info[idx] is None or
                  self._offset_to_symbol_info[idx].size == 0), (
              'Unexpected symbols overlapping')
          self._offset_to_symbol_info[idx] = sym
    return self._offset_to_symbol_info
Computes an array mapping each word in .text to a symbol.

    Returns:
      [symbol_extractor.SymbolInfo or None] For every 4 bytes of the .text
        section, maps it to a symbol, or None.
    
Computes an array mapping each word in .text to a symbol.
Computes an array mapping each word in . text to a symbol .
def GetDumpOffsetToSymbolInfo(self):
    if self._offset_to_symbol_info is None:
      start_syms = [s for s in self.SymbolInfos()
                    if s.name == symbol_extractor.START_OF_TEXT_SYMBOL]
      assert len(start_syms) == 1, 'Can\'t find unique start of text symbol'
      start_of_text = start_syms[0].offset
      max_offset = max(s.offset + s.size for s in self.SymbolInfos())
      text_length_halfwords = (max_offset - start_of_text) // 2
      self._offset_to_symbol_info = [None] * text_length_halfwords
      for sym in self.SymbolInfos():
        offset = sym.offset - start_of_text
        assert offset >= 0, ('Unexpected symbol before the start of text. '
                             'Has the linker script broken?')
        for i in range(offset // 2, (offset + sym.size) // 2):
          assert i < text_length_halfwords
          other_symbol = self._offset_to_symbol_info[i]
          if other_symbol is None or other_symbol.offset > sym.offset:
            self._offset_to_symbol_info[i] = sym
        if sym.name != symbol_extractor.START_OF_TEXT_SYMBOL and sym.size == 0:
          idx = offset // 2
          assert (self._offset_to_symbol_info[idx] is None or
                  self._offset_to_symbol_info[idx].size == 0), (
              'Unexpected symbols overlapping')
          self._offset_to_symbol_info[idx] = sym
    return self._offset_to_symbol_info
def GetDumpOffsetToSymbolInfo ( self ) : if self . _offset_to_symbol_info is None : start_syms = [ s for s in self . SymbolInfos ( ) if s . name == symbol_extractor . START_OF_TEXT_SYMBOL ] assert len ( start_syms ) == 1 , 'Can\'t find unique start of text symbol' start_of_text = start_syms [ 0 ] . offset max_offset = max ( s . offset + s . size for s in self . SymbolInfos ( ) ) text_length_halfwords = ( max_offset - start_of_text ) // 2 self . _offset_to_symbol_info = [ None ] * text_length_halfwords for sym in self . SymbolInfos ( ) : offset = sym . offset - start_of_text assert offset >= 0 , ( 'Unexpected symbol before the start of text. ' 'Has the linker script broken?' ) for i in range ( offset // 2 , ( offset + sym . size ) // 2 ) : assert i < text_length_halfwords other_symbol = self . _offset_to_symbol_info [ i ] if other_symbol is None or other_symbol . offset > sym . offset : self . _offset_to_symbol_info [ i ] = sym if sym . name != symbol_extractor . START_OF_TEXT_SYMBOL and sym . size == 0 : idx = offset // 2 assert ( self . _offset_to_symbol_info [ idx ] is None or self . _offset_to_symbol_info [ idx ] . size == 0 ) , ( 'Unexpected symbols overlapping' ) self . _offset_to_symbol_info [ idx ] = sym return self . _offset_to_symbol_info
Computes an array mapping each word in .text to a symbol.
Computes an array mapping each word in . text to a symbol .
"""Computes an array mapping each word in .text to a symbol.

    Returns:
      [symbol_extractor.SymbolInfo or None] For every 4 bytes of the .text
        section, maps it to a symbol, or None.
    """ # The low bit of offset may be set to indicate a thumb instruction. The # actual offset is still halfword aligned and so the low bit may be # safely ignored in the division by two below. # There may be overlapping symbols, for example fancy # implementations for __ltsf2 and __gtsf2 (merging common tail # code). In this case, keep the one that started first.
[symbol_extractor.SymbolInfo or None] For every 4 bytes of the .text
section, maps it to a symbol, or None.
[ symbol_extractor . SymbolInfo or None ] For every 4 bytes of the . text section maps it to a symbol or None .
self