aboutsummaryrefslogtreecommitdiff
path: root/gdb/async-event.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/async-event.c')
-rw-r--r--gdb/async-event.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/gdb/async-event.c b/gdb/async-event.c
index e5cd63e..55be014 100644
--- a/gdb/async-event.c
+++ b/gdb/async-event.c
@@ -46,6 +46,9 @@ struct async_signal_handler
/* Argument to PROC. */
gdb_client_data client_data;
+
+ /* User-friendly name of this handler. */
+ const char *name;
};
/* PROC is a function to be invoked when the READY flag is set. This
@@ -68,6 +71,9 @@ struct async_event_handler
/* Argument to PROC. */
gdb_client_data client_data;
+
+ /* User-friendly name of this handler. */
+ const char *name;
};
/* All the async_signal_handlers gdb is interested in are kept onto
@@ -127,7 +133,8 @@ initialize_async_signal_handlers (void)
whenever the handler is invoked. */
async_signal_handler *
create_async_signal_handler (sig_handler_func * proc,
- gdb_client_data client_data)
+ gdb_client_data client_data,
+ const char *name)
{
async_signal_handler *async_handler_ptr;
@@ -136,6 +143,7 @@ create_async_signal_handler (sig_handler_func * proc,
async_handler_ptr->next_handler = NULL;
async_handler_ptr->proc = proc;
async_handler_ptr->client_data = client_data;
+ async_handler_ptr->name = name;
if (sighandler_list.first_handler == NULL)
sighandler_list.first_handler = async_handler_ptr;
else
@@ -236,13 +244,12 @@ delete_async_signal_handler (async_signal_handler ** async_handler_ptr)
(*async_handler_ptr) = NULL;
}
-/* Create an asynchronous event handler, allocating memory for it.
- Return a pointer to the newly created handler. PROC is the
- function to call with CLIENT_DATA argument whenever the handler is
- invoked. */
+/* See async-event.h. */
+
async_event_handler *
create_async_event_handler (async_event_handler_func *proc,
- gdb_client_data client_data)
+ gdb_client_data client_data,
+ const char *name)
{
async_event_handler *h;
@@ -251,6 +258,7 @@ create_async_event_handler (async_event_handler_func *proc,
h->next_handler = NULL;
h->proc = proc;
h->client_data = client_data;
+ h->name = name;
if (async_event_handler_list.first_handler == NULL)
async_event_handler_list.first_handler = h;
else