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
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
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
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