Exemplo n.º 1
0
def lookup_litstr(litstr_id, u):
    gloff = V('HPHP::kGlobalLitstrOffset')

    if litstr_id >= gloff:
        litstr_id -= gloff
        u = V('HPHP::LitstrTable::s_litstrTable')

    val = u['m_namedInfo']
    # get the base type
    ty = val.type.fields()[0].type
    val = val.address.cast(ty.pointer()).dereference()
    return idx.compact_vector_at(val, litstr_id)
Exemplo n.º 2
0
def lookup_litstr(litstr_id, u):
    gloff = V('HPHP::kGlobalLitstrOffset')

    if litstr_id >= gloff:
        litstr_id -= gloff
        u = V('HPHP::LitstrTable::s_litstrTable')

    val = u['m_namedInfo']
    # get the base type
    ty = val.type.fields()[0].type
    val = val.address.cast(ty.pointer()).dereference()
    return idx.compact_vector_at(val, litstr_id)
Exemplo n.º 3
0
def lookup_litstr(litstr_id, u):
    uloff = V('HPHP::kUnitLitstrOffset')

    if litstr_id < uloff:
        u = V('HPHP::LitstrTable::s_litstrTable')
    else:
        litstr_id -= uloff
        u = u.cast(T('HPHP::UnitExtended').pointer())

    val = u['m_namedInfo']
    # get the base type
    ty = val.type.fields()[0].type
    val = val.address.cast(ty.pointer()).dereference()
    return idx.compact_vector_at(val, litstr_id)
Exemplo n.º 4
0
def php_line_number(func, pc):
    unit = func['m_unit']

    line_map = unit['m_lineMap']['val']

    if line_map is not None:
        i = 0
        while True:
            r = idxs.compact_vector_at(line_map, i)
            if r is None:
                break
            if r['first']['base'] <= pc and r['first']['past'] > pc:
                return r['second']
            i += 1

    return php_line_number_from_repo(func, pc)
Exemplo n.º 5
0
def php_line_number(func, pc):
    unit = func['m_unit']

    line_map = unit['m_lineMap']['val']

    if line_map is not None:
        i = 0
        while True:
            r = idxs.compact_vector_at(line_map, i)
            if r is None:
                break
            if r['first']['base'] <= pc and r['first']['past'] > pc:
                return r['second']
            i += 1

    return php_line_number_from_repo(func, pc)