author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 19 Jun 2015 08:46:40 +0100 | |
changeset 5 | 370848e6fc80 |
parent 2 | ef575a931434 |
permissions | -rw-r--r-- |
import stx.gdb.commands import stx.gdb.objects import gdb.types def printer_lookup(val): try: v = val t = val.type.strip_typedefs(); if (t.code == gdb.TYPE_CODE_PTR): t = t.target() else: return None if (t.code == gdb.TYPE_CODE_STRUCT): name = str(t) if (name == 'struct __instance'): return stx.gdb.objects.create(val) except: return None def printer_register(objfile): objfile.pretty_printers.append(printer_lookup)