- GDB_NOTIFIER keeps track of the event sources. Event sources for
- gdb are currently the UI and the target. Gdb communicates with the
- command line user interface via the readline library and usually
- communicates with remote targets via a serial port. Serial ports
- are represented in GDB as file descriptors and select/poll calls.
- For native targets instead, the communication consists of calls to
- ptrace and waits (via signals) or calls to poll/select (via file
- descriptors). In the current gdb, the code handling events related
- to the target resides in the wait_for_inferior function and in
- various target specific files (*-tdep.c).
+ GDB_NOTIFIER keeps track of the file descriptor based event
+ sources. ASYNC_EVENT_HANDLER_LIST keeps track of asynchronous
+ event sources that are signalled by some component of gdb, usually
+ a target_ops instance. Event sources for gdb are currently the UI
+ and the target. Gdb communicates with the command line user
+ interface via the readline library and usually communicates with
+ remote targets via a serial port. Serial ports are represented in
+ GDB as file descriptors and select/poll calls. For native targets
+ instead, the communication varies across operating system debug
+ APIs, but usually consists of calls to ptrace and waits (via
+ signals) or calls to poll/select (via file descriptors). In the
+ current gdb, the code handling events related to the target resides
+ in wait_for_inferior for synchronous targets; or, for asynchronous
+ capable targets, by having the target register either a target
+ controlled file descriptor and/or an asynchronous event source in
+ the event loop, with the fetch_inferior_event function as the event
+ callback. In both the synchronous and asynchronous cases, usually
+ the target event is collected through the target_wait interface.
+ The target is free to install other event sources in the event loop
+ if it so requires.