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:
-
StartEvent– -
HandlerPriority–A priority level for an event handler, ordered from highest to lowest priority.
Functions:
-
wrap_safe_event_handler–Wraps an event handler to ensure it is only executed when the event is safe.
-
pause– -
unpause– -
connect– -
exit– -
cont– -
new_objfile– -
stop– -
start– -
thread– -
before_prompt– -
reg_changed– -
mem_changed– -
log_objfiles– -
invoke_event– -
after_reload– -
on_reload–
Attributes:
-
DISABLED– -
DISABLED_DEADLOCK– -
ENABLED– -
debug– -
gdb_workaround_stop_event– -
P– -
T– -
queued_events(Deque[Callable[..., Any]]) – -
executing_event– -
workaround_thread_conn– -
registered(dict[Any, dict[HandlerPriority, list[Callable[..., Any]]]]) – -
connected– -
paused–
debug module-attribute ¤
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[Any, dict[HandlerPriority, list[Callable[..., Any]]]] = {
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–
HandlerPriority ¤
Bases: Enum
A priority level for an event handler, ordered from highest to lowest priority.
Attributes:
-
CACHE_CLEAR– -
LOW–
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
connect ¤
connect(
func: Callable[[], T],
event_handler: Any,
name: str = "",
priority: HandlerPriority = LOW,
) -> Callable[[], T]