library/src/main/cpp/MapData.cpp
// Find the containing map info for the PC.
Find the containing map info for the PC.
Find the containing map info for the PC .
const MapEntry* MapData::find(uintptr_t pc, uintptr_t* rel_pc) {
    MapEntry pc_entry(pc);
    auto it = entries_.find(&pc_entry);
    if (it == entries_.end()) {
        ReadMaps();
    }
    it = entries_.find(&pc_entry);
    if (it == entries_.end()) {
        return nullptr;
    }
    MapEntry* entry = *it;
    if (!entry->load_base_read) {
        read_loadbase(entry);
    }
    if (rel_pc) {
        *rel_pc = pc - entry->start + entry->load_base;
    }
    return entry;
}
const MapEntry * MapData :: find ( uintptr_t pc , uintptr_t * rel_pc ) { MapEntry pc_entry ( pc ) ; auto it = entries_ . find ( & pc_entry ) ; if ( it == entries_ . end ( ) ) { ReadMaps ( ) ; } it = entries_ . find ( & pc_entry ) ; if ( it == entries_ . end ( ) ) { return nullptr ; } MapEntry * entry = * it ; if ( ! entry -> load_base_read ) { read_loadbase ( entry ) ; } if ( rel_pc ) { * rel_pc = pc - entry -> start + entry -> load_base ; } return entry ; }
Find the containing map info for the PC.
Find the containing map info for the PC .