From 28ee05e92474f1a72e289ff06050351938b8f807 Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Mon, 30 Sep 2002 20:06:53 +0000 Subject: [PATCH] * gdb-events.sh (selected_thread_changed): New event. * gdb-events.c: Regenerated. * gdb-events.h: Regenerated. --- gdb/ChangeLog | 6 ++++++ gdb/gdb-events.c | 31 +++++++++++++++++++++++++++++++ gdb/gdb-events.h | 4 ++++ gdb/gdb-events.sh | 1 + 4 files changed, 42 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6c0c45aa2b8..0c8030eade0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-09-30 Keith Seitz + + * gdb-events.sh (selected_thread_changed): New event. + * gdb-events.c: Regenerated. + * gdb-events.h: Regenerated. + 2002-09-30 Hans-Peter Nilsson * MAINTAINERS: Add self to Write After Approval list. diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c index e32d0e49d63..63ee3bc400b 100644 --- a/gdb/gdb-events.c +++ b/gdb/gdb-events.c @@ -139,6 +139,16 @@ selected_frame_level_changed_event (int level) current_event_hooks->selected_frame_level_changed (level); } +void +selected_thread_changed_event (int thread_num) +{ + if (gdb_events_debug) + fprintf_unfiltered (gdb_stdlog, "selected_thread_changed_event\n"); + if (!current_event_hooks->selected_thread_changed) + return; + current_event_hooks->selected_thread_changed (thread_num); +} + #endif #if WITH_GDB_EVENTS @@ -173,6 +183,7 @@ enum gdb_event architecture_changed, target_changed, selected_frame_level_changed, + selected_thread_changed, nr_gdb_events }; @@ -211,6 +222,11 @@ struct selected_frame_level_changed int level; }; +struct selected_thread_changed + { + int thread_num; + }; + struct event { enum gdb_event type; @@ -224,6 +240,7 @@ struct event struct tracepoint_delete tracepoint_delete; struct tracepoint_modify tracepoint_modify; struct selected_frame_level_changed selected_frame_level_changed; + struct selected_thread_changed selected_thread_changed; } data; }; @@ -319,6 +336,15 @@ queue_selected_frame_level_changed (int level) append (event); } +static void +queue_selected_thread_changed (int thread_num) +{ + struct event *event = XMALLOC (struct event); + event->type = selected_thread_changed; + event->data.selected_thread_changed.thread_num = thread_num; + append (event); +} + void gdb_events_deliver (struct gdb_events *vector) { @@ -374,6 +400,10 @@ gdb_events_deliver (struct gdb_events *vector) vector->selected_frame_level_changed (event->data.selected_frame_level_changed.level); break; + case selected_thread_changed: + vector->selected_thread_changed + (event->data.selected_thread_changed.thread_num); + break; } delivering_events = event->next; xfree (event); @@ -395,6 +425,7 @@ _initialize_gdb_events (void) queue_event_hooks.architecture_changed = queue_architecture_changed; queue_event_hooks.target_changed = queue_target_changed; queue_event_hooks.selected_frame_level_changed = queue_selected_frame_level_changed; + queue_event_hooks.selected_thread_changed = queue_selected_thread_changed; #endif c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger, diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h index c3332d7a808..4836568f3c4 100644 --- a/gdb/gdb-events.h +++ b/gdb/gdb-events.h @@ -61,6 +61,7 @@ typedef void (gdb_events_tracepoint_modify_ftype) (int number); typedef void (gdb_events_architecture_changed_ftype) (void); typedef void (gdb_events_target_changed_ftype) (void); typedef void (gdb_events_selected_frame_level_changed_ftype) (int level); +typedef void (gdb_events_selected_thread_changed_ftype) (int thread_num); /* gdb-events: object. */ @@ -76,6 +77,7 @@ struct gdb_events gdb_events_architecture_changed_ftype *architecture_changed; gdb_events_target_changed_ftype *target_changed; gdb_events_selected_frame_level_changed_ftype *selected_frame_level_changed; + gdb_events_selected_thread_changed_ftype *selected_thread_changed; }; @@ -91,6 +93,7 @@ extern void tracepoint_modify_event (int number); extern void architecture_changed_event (void); extern void target_changed_event (void); extern void selected_frame_level_changed_event (int level); +extern void selected_thread_changed_event (int thread_num); /* When GDB_EVENTS are not being used, completly disable them. */ @@ -105,6 +108,7 @@ extern void selected_frame_level_changed_event (int level); #define architecture_changed_event() 0 #define target_changed_event() 0 #define selected_frame_level_changed_event(level) 0 +#define selected_thread_changed_event(thread_num) 0 #endif /* Install custom gdb-events hooks. */ diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh index ed3340b0e4e..458e4b60b9c 100755 --- a/gdb/gdb-events.sh +++ b/gdb/gdb-events.sh @@ -67,6 +67,7 @@ f:void:tracepoint_modify:int number:number f:void:architecture_changed:void f:void:target_changed:void f:void:selected_frame_level_changed:int level:level +f:void:selected_thread_changed:int thread_num:thread_num #*:void:annotate_starting_hook:void #*:void:annotate_stopped_hook:void #*:void:annotate_signalled_hook:void -- 2.30.2