def METHOD_NAME(*a):
    if debug:
        sys.stdout.write(f"{name!r} {func.__module__}.{func.__name__} {a!r}\n")
    if a and isinstance(a[0], gdb.NewObjFileEvent):
        objfile = a[0].new_objfile
        handler = f"{func.__module__}.{func.__name__}"
        path = objfile.filename
        dispatched = objfile_cache.get(path, set())
        if handler in dispatched:
            return
        dispatched.add(handler)
        objfile_cache[path] = dispatched
    try:
        func()
    except Exception as e:
        import pwndbg.exception
        pwndbg.exception.handle()
        raise e