debuggerd/utility.c
const mapinfo *pc_to_mapinfo(mapinfo *mi, unsigned pc, unsigned *rel_pc)
{
    while(mi) {
        if((pc >= mi->start) && (pc < mi->end)){
            // Only calculate the relative offset for shared libraries
            if (strstr(mi->name, ".so")) {
                *rel_pc = pc - mi->start;
            }
            return mi;
        }
        mi = mi->next;
    }
    return NULL;
}
/* 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 mapinfo *pc_to_mapinfo(mapinfo *mi, unsigned pc, unsigned *rel_pc)
{
    while(mi) {
        if((pc >= mi->start) && (pc < mi->end)){
            if (strstr(mi->name, ".so")) {
                *rel_pc = pc - mi->start;
            }
            return mi;
        }
        mi = mi->next;
    }
    return NULL;
}
const mapinfo * pc_to_mapinfo ( mapinfo * mi , unsigned pc , unsigned * rel_pc ) { while ( mi ) { if ( ( pc >= mi -> start ) && ( pc < mi -> end ) ) { if ( strstr ( mi -> name , " " ) ) { * rel_pc = pc - mi -> start ; } return mi ; } mi = mi -> next ; } return NULL ; }
Find the containing map info for the pc
Find the containing map info for the pc
// Only calculate the relative offset for shared libraries