third_party/android_platform/development/scripts/symbol.py
def SymbolInformationForSet(lib, unique_addrs, get_detailed_info,
                            cpu_arch=ARCH):
  """Look up symbol information for a set of addresses from the given library.

  Args:
    lib: library (or executable) pathname containing symbols
    unique_addrs: set of hexidecimal addresses
    get_detailed_info: If True, add additional info from objdump.
    cpu_arch: Target CPU architecture.

  Returns:
    A dictionary of the form {addr: [(source_symbol, source_location,
    object_symbol_with_offset)]} where each address has a list of
    associated symbols and locations.  The list is always non-empty.

    If the function has been inlined then the list may contain
    more than one element with the symbols for the most deeply
    nested inlined location appearing first.  The list is
    always non-empty, even if no information is available.

    Usually you want to display the source_location and
    object_symbol_with_offset from the last element in the list.
  """
  if not lib:
    return None

  addr_to_line = _CallAddr2LineForSet(lib, unique_addrs, cpu_arch)
  if not addr_to_line:
    return None

  if get_detailed_info:
    addr_to_objdump = _CallObjdumpForSet(lib, unique_addrs, cpu_arch)
    if not addr_to_objdump:
      return None
  else:
    addr_to_objdump = dict((addr, ("", 0)) for addr in unique_addrs)

  result = {}
  for addr in unique_addrs:
    source_info = addr_to_line.get(addr)
    if not source_info:
      source_info = [(None, None)]
    if addr in addr_to_objdump:
      (object_symbol, object_offset) = addr_to_objdump.get(addr)
      object_symbol_with_offset = _FormatSymbolWithOffset(object_symbol,
                                                          object_offset)
    else:
      object_symbol_with_offset = None
    result[addr] = [(source_symbol, source_location, object_symbol_with_offset)
        for (source_symbol, source_location) in source_info]

  return result
Look up symbol information for a set of addresses from the given library.

  Args:
    lib: library (or executable) pathname containing symbols
    unique_addrs: set of hexidecimal addresses
    get_detailed_info: If True, add additional info from objdump.
    cpu_arch: Target CPU architecture.

  Returns:
    A dictionary of the form {addr: [(source_symbol, source_location,
    object_symbol_with_offset)]} where each address has a list of
    associated symbols and locations.  The list is always non-empty.

    If the function has been inlined then the list may contain
    more than one element with the symbols for the most deeply
    nested inlined location appearing first.  The list is
    always non-empty, even if no information is available.

    Usually you want to display the source_location and
    object_symbol_with_offset from the last element in the list.
  
Look up symbol information for a set of addresses from the given library.
Look up symbol information for a set of addresses from the given library .
def SymbolInformationForSet(lib, unique_addrs, get_detailed_info,
                            cpu_arch=ARCH):
  if not lib:
    return None
  addr_to_line = _CallAddr2LineForSet(lib, unique_addrs, cpu_arch)
  if not addr_to_line:
    return None
  if get_detailed_info:
    addr_to_objdump = _CallObjdumpForSet(lib, unique_addrs, cpu_arch)
    if not addr_to_objdump:
      return None
  else:
    addr_to_objdump = dict((addr, ("", 0)) for addr in unique_addrs)
  result = {}
  for addr in unique_addrs:
    source_info = addr_to_line.get(addr)
    if not source_info:
      source_info = [(None, None)]
    if addr in addr_to_objdump:
      (object_symbol, object_offset) = addr_to_objdump.get(addr)
      object_symbol_with_offset = _FormatSymbolWithOffset(object_symbol,
                                                          object_offset)
    else:
      object_symbol_with_offset = None
    result[addr] = [(source_symbol, source_location, object_symbol_with_offset)
        for (source_symbol, source_location) in source_info]
  return result
def SymbolInformationForSet ( lib , unique_addrs , get_detailed_info , cpu_arch = ARCH ) : if not lib : return None addr_to_line = _CallAddr2LineForSet ( lib , unique_addrs , cpu_arch ) if not addr_to_line : return None if get_detailed_info : addr_to_objdump = _CallObjdumpForSet ( lib , unique_addrs , cpu_arch ) if not addr_to_objdump : return None else : addr_to_objdump = dict ( ( addr , ( "" , 0 ) ) for addr in unique_addrs ) result = { } for addr in unique_addrs : source_info = addr_to_line . get ( addr ) if not source_info : source_info = [ ( None , None ) ] if addr in addr_to_objdump : ( object_symbol , object_offset ) = addr_to_objdump . get ( addr ) object_symbol_with_offset = _FormatSymbolWithOffset ( object_symbol , object_offset ) else : object_symbol_with_offset = None result [ addr ] = [ ( source_symbol , source_location , object_symbol_with_offset ) for ( source_symbol , source_location ) in source_info ] return result
Look up symbol information for a set of addresses from the given library.
Look up symbol information for a set of addresses from the given library .
"""Look up symbol information for a set of addresses from the given library.

  Args:
    lib: library (or executable) pathname containing symbols
    unique_addrs: set of hexidecimal addresses
    get_detailed_info: If True, add additional info from objdump.
    cpu_arch: Target CPU architecture.

  Returns:
    A dictionary of the form {addr: [(source_symbol, source_location,
    object_symbol_with_offset)]} where each address has a list of
    associated symbols and locations.  The list is always non-empty.

    If the function has been inlined then the list may contain
    more than one element with the symbols for the most deeply
    nested inlined location appearing first.  The list is
    always non-empty, even if no information is available.

    Usually you want to display the source_location and
    object_symbol_with_offset from the last element in the list.
  """
A dictionary of the form {addr: [(source_symbol, source_location,
object_symbol_with_offset)]} where each address has a list of
associated symbols and locations.  The list is always non-empty.

If the function has been inlined then the list may contain
more than one element with the symbols for the most deeply
nested inlined location appearing first.  The list is
always non-empty, even if no information is available.

Usually you want to display the source_location and
object_symbol_with_offset from the last element in the list.
A dictionary of the form { addr : [ ( source_symbol source_location object_symbol_with_offset ) ] } where each address has a list of associated symbols and locations . The list is always non - empty . If the function has been inlined then the list may contain more than one element with the symbols for the most deeply nested inlined location appearing first . The list is always non - empty even if no information is available . Usually you want to display the source_location and object_symbol_with_offset from the last element in the list .
lib
library (or executable) pathname containing symbols
library ( or executable ) pathname containing symbols
unique_addrs
set of hexidecimal addresses
set of hexidecimal addresses
get_detailed_info
If True, add additional info from objdump.
If True add additional info from objdump .
cpu_arch
Target CPU architecture.
Target CPU architecture .