events ¤
Enables callbacks into functions to be automatically invoked when various events occur to the debuggee (e.g. STOP on SIGINT) by using a decorator.
Classes:
Functions:
-
wrap_safe_event_handler–Wraps an event handler to ensure it is only executed when the event is safe.
-
pause– -
unpause– -
event_handler_factory–Essentially the implementation of pwndbg.dbg_mod.gdb.event_handler().
-
log_objfiles– -
invoke_event–Invoke all registered handlers for a certain event_registry.
-
after_reload– -
on_reload–
Attributes:
-
DISABLED– -
DISABLED_DEADLOCK– -
ENABLED– -
gdb_workaround_stop_event– -
P– -
T– -
queued_events(Deque[Callable[..., Any]]) – -
executing_event– -
workaround_thread_conn– -
registered(dict[EventRegistry[Any], dict[EventHandlerPriority, list[Callable[..., None]]]]) – -
paused–
gdb_workaround_stop_event module-attribute ¤
gdb_workaround_stop_event = add_param('gdb-workaround-stop-event', DISABLED, "asynchronous stop events to improve 'commands' functionality", help_docstring=f'
Note that this may cause unexpected behavior with Pwndbg or gdb.execute.
Values explained:
+ `{DISABLED}` - Disable the workaround (default).
+ `{DISABLED_DEADLOCK}` - Disable only deadlock detection; deadlocks may still occur.
+ `{ENABLED}` - Enable asynchronous stop events; gdb.execute may behave unexpectedly (asynchronously).
', param_class=PARAM_ENUM, enum_sequence=[DISABLED, DISABLED_DEADLOCK, ENABLED])
registered module-attribute ¤
registered: dict[
EventRegistry[Any], dict[EventHandlerPriority, list[Callable[..., None]]]
] = {
exited: {},
cont: {},
new_objfile: {},
stop: {},
start: {},
new_thread: {},
before_prompt: {},
memory_changed: {},
register_changed: {},
}
StartEvent ¤
Methods:
-
connect– -
disconnect– -
on_new_objfile– -
on_exited– -
on_stop–
Attributes:
-
registered(list[Callable[..., Any]]) – -
running–
wrap_safe_event_handler ¤
Wraps an event handler to ensure it is only executed when the event is safe. Invalid events are queued and executed later when safe.
Note: Avoid using gdb.post_event because of another bug in gdbserver where the gdb.newest_frame function may not work properly.
Workaround to fix bug in gdbserver (gdb.events.new_objfile): #2576 Workaround to fix bug in gdb (gdb.events.stop): #425
event_handler_factory ¤
event_handler_factory(
event_registry: EventRegistry[Any],
event_name: str,
priority: EventHandlerPriority,
) -> Callable[[Callable[..., None]], Callable[..., None]]
Essentially the implementation of pwndbg.dbg_mod.gdb.event_handler().
Takes a gdb.EventRegistry because that contains some events that pwndbg.dbg_mod.EventType doesn't.
Read the first few paragraphs of: https://sourceware.org/gdb/current/onlinedocs/gdb.html/Events-In-Python.html#Events-In-Python
invoke_event ¤
Invoke all registered handlers for a certain event_registry. event_data may be None if we manually ran this function.