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:
-
debug– -
gdb_workaround_stop_event– -
P– -
T– -
queued_events(Deque[Callable[..., Any]]) – -
executing_event– -
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",
0,
"asynchronous stop events to improve 'commands' functionality.",
help_docstring="\nNote: This may cause unexpected behavior with pwndbg or gdb.execute.\n\nValues:\n0 - Disable the workaround (default).\n1 - Enable asynchronous stop events; gdb.execute may behave unexpectedly(asynchronously).\n2 - Disable only deadlock detection; deadlocks may still occur.\n ",
)
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]