示例#1
0
def resolve_kernel(ip):
    if not kernel:
        parse_kernel()
    n = util.find_le(kernel, ip)
    if n:
        return n[1], ip - n[0]
    return None
示例#2
0
文件: kernel.py 项目: wushka00/60secs
def resolve_kernel(ip):
    if not kernel:
        parse_kernel()
    n = util.find_le(kernel, ip)
    if n:
        return n[1], ip - n[0]
    return None
示例#3
0
文件: elf.py 项目: ugiwgh/pmu-tools
def resolve_line(fn, ip):
    elffile = find_elf_file(fn)
    if fn not in lines and elffile.has_dwarf_info():
        lines[fn] = build_line_table(elffile.get_dwarf_info())

    src = None
    if resolve_line and fn in lines:
        pos = util.find_le(lines[fn], ip)
        if pos:
            src = "%s:%d" % (pos[2], pos[3])
    return src
示例#4
0
文件: elf.py 项目: banitag1/pmu-tools
def resolve_line(fn, ip):
    elffile = find_elf_file(fn)
    if fn not in lines and elffile.has_dwarf_info():
        lines[fn] = build_line_table(elffile.get_dwarf_info())

    src = None
    if resolve_line and fn in lines:
        pos = util.find_le(lines[fn], ip)
        if pos:
            src = "%s:%d" % (pos[2], pos[3])    
    return src
示例#5
0
文件: elf.py 项目: ugiwgh/pmu-tools
def resolve_sym(fn, ip):
    elffile = find_elf_file(fn)
    global last_sym

    if fn not in symtables:
        symtables[fn] = build_symtab(elffile)

    if last_sym and last_sym[0] <= ip <= last_sym[1]:
        return last_sym[2], ip - last_sym[0]

    loc = None
    offset = None
    if fn in symtables:
        sym = util.find_le(symtables[fn], ip)
        if sym:
            loc, offset = sym[2], ip - sym[0]

    return loc, offset
示例#6
0
文件: elf.py 项目: banitag1/pmu-tools
def resolve_sym(fn, ip):
    elffile = find_elf_file(fn)
    global last_sym
        
    if fn not in symtables:
        symtables[fn] = build_symtab(elffile)

    if last_sym and last_sym[0] <= ip <= last_sym[1]:
        return last_sym[2], ip - last_sym[0]

    loc = None
    offset = None
    if fn in symtables:
        sym = util.find_le(symtables[fn], ip)
        if sym:
            loc, offset = sym[2], ip - sym[0]

    return loc, offset
示例#7
0
文件: elf.py 项目: wushka00/60secs
def resolve_sym(fn, ip):
    elffile = find_elf_file(fn)
    if elffile is None:
        return "?", 0
    global last_sym

    try:
        if fn not in symtables:
            symtables[fn] = build_symtab(elffile)

        if last_sym and last_sym[0] <= ip <= last_sym[1]:
            return last_sym[2], ip - last_sym[0]

        loc = None
        offset = None
        if fn in symtables:
            sym = util.find_le(symtables[fn], ip)
            if sym:
                loc, offset = sym[2], ip - sym[0]
    except elftools.common.exceptions.ELFError:
        return "?", 0

    return loc, offset