Esempio n. 1
0
bool
DYLDRendezvous::TakeSnapshot(SOEntryList &entry_list)
{
    SOEntry entry;

    if (m_current.map_addr == 0)
        return false;

    // Clear previous entries since we are about to obtain an up to date list.
    entry_list.clear();

    for (addr_t cursor = m_current.map_addr; cursor != 0; cursor = entry.next)
    {
        if (!ReadSOEntryFromMemory(cursor, entry))
            return false;

        // Only add shared libraries and not the executable.
        if (SOEntryIsMainExecutable(entry))
            continue;

        entry_list.push_back(entry);
    }

    return true;
}
bool HexagonDYLDRendezvous::TakeSnapshot(SOEntryList &entry_list) {
  SOEntry entry;

  if (m_current.map_addr == 0)
    return false;

  for (addr_t cursor = m_current.map_addr; cursor != 0; cursor = entry.next) {
    if (!ReadSOEntryFromMemory(cursor, entry))
      return false;

    // Only add shared libraries and not the executable.
    // On Linux this is indicated by an empty path in the entry.
    // On FreeBSD it is the name of the executable.
    if (entry.path.empty() || ::strcmp(entry.path.c_str(), m_exe_path) == 0)
      continue;

    entry_list.push_back(entry);
  }

  return true;
}