int in_fputs = 0;
-int (*ui_load_progress_hook) PARAMS ((char *, unsigned long));
-void (*pre_add_symbol_hook) PARAMS ((char *));
-void (*post_add_symbol_hook) PARAMS ((void));
+extern int (*ui_load_progress_hook) PARAMS ((char *, unsigned long));
+extern void (*pre_add_symbol_hook) PARAMS ((char *));
+extern void (*post_add_symbol_hook) PARAMS ((void));
+extern void (*selected_frame_level_changed_hook) PARAMS ((int));
#ifdef __CYGWIN32__
extern void (*ui_loop_hook) PARAMS ((int));
#endif
+
static void gdbtk_create_tracepoint PARAMS ((struct tracepoint *));
static void gdbtk_delete_tracepoint PARAMS ((struct tracepoint *));
static void gdbtk_modify_tracepoint PARAMS ((struct tracepoint *));
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));
/*
* gdbtk_fputs can't be static, because we need to call it in gdbtk.c.
delete_tracepoint_hook = gdbtk_delete_tracepoint;
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
gdbtk_ignorable_warning (warning)
const char *warning;
{
- char buf[200], *merge[2];
- char *command;
-
+ char buf[512];
sprintf (buf, warning);
gdbtk_two_elem_cmd ("gdbtk_tcl_ignorable_warning", buf);
-
}
-
-
static void
pc_changed()
{
#endif
{
va_list args;
- char buf[200], *merge[2];
- char *command;
+ char buf[200];
#ifdef ANSI_PROTOTYPES
va_start (args, format);
if (cmdblk->class == class_run || cmdblk->class == class_trace)
{
-/* HACK! HACK! This is to get the gui to update the tstart/tstop
- button only incase of tstart/tstop commands issued from the console
- We don't want to update the src window, so we need to have specific
- procedures to do tstart and tstop
- Unfortunately this will not display errors from tstart or tstop in the
- console window itself, but as dialogs.*/
+ /* HACK! HACK! This is to get the gui to update the tstart/tstop
+ button only incase of tstart/tstop commands issued from the console
+ We don't want to update the src window, so we need to have specific
+ procedures to do tstart and tstop
+ Unfortunately this will not display errors from tstart or tstop in the
+ console window itself, but as dialogs.*/
if (!strcmp(cmdblk->name, "tstart") && !No_Update)
{
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_tstart");
- (*cmdblk->function.cfunc)(arg, from_tty);
+ Tcl_Eval (gdbtk_interp, "gdbtk_tcl_tstart");
+ (*cmdblk->function.cfunc)(arg, from_tty);
}
else if (!strcmp(cmdblk->name, "tstop") && !No_Update)
- {
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_tstop");
- (*cmdblk->function.cfunc)(arg, from_tty);
- }
-/* end of hack */
- else
- {
- running_now = 1;
- if (!No_Update)
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_busy");
- (*cmdblk->function.cfunc)(arg, from_tty);
- running_now = 0;
- if (!No_Update)
- Tcl_Eval (gdbtk_interp, "gdbtk_tcl_idle");
- }
+ {
+ Tcl_Eval (gdbtk_interp, "gdbtk_tcl_tstop");
+ (*cmdblk->function.cfunc)(arg, from_tty);
+ }
+ /* end of hack */
+ else
+ {
+ running_now = 1;
+ if (!No_Update)
+ Tcl_Eval (gdbtk_interp, "gdbtk_tcl_busy");
+ (*cmdblk->function.cfunc)(arg, from_tty);
+ running_now = 0;
+ if (!No_Update)
+ Tcl_Eval (gdbtk_interp, "gdbtk_tcl_idle");
+ }
}
else
(*cmdblk->function.cfunc)(arg, from_tty);
int pid;
struct target_waitstatus *ourstatus;
{
- gdbtk_start_timer ();
+ /* Don't run the timer on various targets... */
+ if (!STREQ (target_shortname, "ice"))
+ gdbtk_start_timer ();
pid = target_wait (pid, ourstatus);
gdbtk_stop_timer ();
return pid;
filename = symtab_to_filename (sal.symtab);
if (filename == NULL)
filename = "N/A";
- sprintf (buf, "gdbtk_tcl_tracepoint %s %d 0x%lx %d {%s}", action, tp->number,
+ sprintf (buf, "gdbtk_tcl_tracepoint %s %d 0x%lx %d {%s} %d", action, tp->number,
(long)tp->address, sal.line, filename, tp->pass_count);
v = Tcl_Eval (gdbtk_interp, buf);
}
}
+static void
+gdbtk_selected_frame_changed (level)
+ int 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;
+}