aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbtk-hooks.c
diff options
context:
space:
mode:
authorMartin Hunt <hunt@redhat.com>1998-08-30 07:53:29 +0000
committerMartin Hunt <hunt@redhat.com>1998-08-30 07:53:29 +0000
commit4ff5d55a081fbb280b68d912bf3a4b5f26541b5c (patch)
tree39ec26e18a03d02cc992a5afe7b352eb3b36b6e6 /gdb/gdbtk-hooks.c
parentd405c4a1aec90299f768f191e63494407ce84536 (diff)
downloadgdb-4ff5d55a081fbb280b68d912bf3a4b5f26541b5c.zip
gdb-4ff5d55a081fbb280b68d912bf3a4b5f26541b5c.tar.gz
gdb-4ff5d55a081fbb280b68d912bf3a4b5f26541b5c.tar.bz2
Sun Aug 30 00:49:18 1998 Martin M. Hunt <hunt@cygnus.com>
* gdbtk-cmds.c (Gdbtk_Init): Link C variable gdb_context with tcl variable gdb_context_id. * gdbtk-hooks.c (gdbtk_context_change): Implement new hook called context_hook. Called when threads change. * gdbtk.c: Initialize gdb_context. * gdbtk.h: Declare gdb_context. * infrun (wait_for_inferior): Call context_hook. * thread.c (thread_command): Call context_hook. * defs.h: Declare context_hook.
Diffstat (limited to 'gdb/gdbtk-hooks.c')
-rw-r--r--gdb/gdbtk-hooks.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/gdbtk-hooks.c b/gdb/gdbtk-hooks.c
index b3178bb..d4a9fa1 100644
--- a/gdb/gdbtk-hooks.c
+++ b/gdb/gdbtk-hooks.c
@@ -110,6 +110,8 @@ static void gdbtk_post_add_symbol PARAMS ((void));
static void pc_changed PARAMS ((void));
static void tracepoint_notify PARAMS ((struct tracepoint *, const char *));
static void gdbtk_selected_frame_changed PARAMS ((int));
+static void gdbtk_context_change PARAMS ((int));
+void (*context_hook) PARAMS ((int));
/*
* gdbtk_fputs can't be static, because we need to call it in gdbtk.c.
@@ -157,7 +159,7 @@ gdbtk_add_hooks(void)
modify_tracepoint_hook = gdbtk_modify_tracepoint;
pc_changed_hook = pc_changed;
selected_frame_level_changed_hook = gdbtk_selected_frame_changed;
-
+ context_hook = gdbtk_context_change;
}
/* These control where to put the gdb output which is created by
@@ -690,3 +692,12 @@ gdbtk_selected_frame_changed (level)
{
Tcl_UpdateLinkedVar (gdbtk_interp, "gdb_selected_frame_level");
}
+
+/* Called when the current thread changes. */
+/* gdb_context is linked to the tcl variable "gdb_context_id" */
+static void
+gdbtk_context_change (num)
+ int num;
+{
+ gdb_context = num;
+}