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__
+#ifdef __CYGWIN__
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_trace_find PARAMS ((char *arg, int from_tty));
+static void gdbtk_trace_start_stop PARAMS ((int, int));
static void gdbtk_create_breakpoint PARAMS ((struct breakpoint *));
static void gdbtk_delete_breakpoint PARAMS ((struct breakpoint *));
static void gdbtk_modify_breakpoint PARAMS ((struct breakpoint *));
+static void gdbtk_file_changed PARAMS ((char *));
+static void gdbtk_exec_file_display PARAMS ((char *));
static void tk_command_loop PARAMS ((void));
static void gdbtk_call_command PARAMS ((struct cmd_list_element *, char *, int));
static int gdbtk_wait PARAMS ((int, struct target_waitstatus *));
gdbtk_readline_begin ();
#endif
static void gdbtk_readline_end PARAMS ((void));
-static void gdbtk_flush PARAMS ((FILE *));
+static void gdbtk_flush PARAMS ((GDB_FILE *));
static void gdbtk_pre_add_symbol PARAMS ((char *));
static void gdbtk_print_frame_info PARAMS ((struct symtab *, int, int, int));
static void gdbtk_post_add_symbol PARAMS ((void));
* See note there for details.
*/
-void gdbtk_fputs PARAMS ((const char *, FILE *));
+void gdbtk_fputs PARAMS ((const char *, GDB_FILE *));
int gdbtk_load_hash PARAMS ((char *, unsigned long));
static void breakpoint_notify PARAMS ((struct breakpoint *, const char *));
delete_breakpoint_hook = gdbtk_delete_breakpoint;
modify_breakpoint_hook = gdbtk_modify_breakpoint;
- interactive_hook = gdbtk_interactive;
- target_wait_hook = gdbtk_wait;
- ui_load_progress_hook = gdbtk_load_hash;
-#ifdef __CYGWIN32__
+ interactive_hook = gdbtk_interactive;
+ target_wait_hook = gdbtk_wait;
+ ui_load_progress_hook = gdbtk_load_hash;
+
+#ifdef __CYGWIN__
ui_loop_hook = x_event;
#endif
- pre_add_symbol_hook = gdbtk_pre_add_symbol;
- post_add_symbol_hook = gdbtk_post_add_symbol;
+ pre_add_symbol_hook = gdbtk_pre_add_symbol;
+ post_add_symbol_hook = gdbtk_post_add_symbol;
+ file_changed_hook = gdbtk_file_changed;
+ exec_file_display_hook = gdbtk_exec_file_display;
create_tracepoint_hook = gdbtk_create_tracepoint;
delete_tracepoint_hook = gdbtk_delete_tracepoint;
modify_tracepoint_hook = gdbtk_modify_tracepoint;
+ trace_find_hook = gdbtk_trace_find;
+ trace_start_stop_hook = gdbtk_trace_start_stop;
pc_changed_hook = pc_changed;
selected_frame_level_changed_hook = gdbtk_selected_frame_changed;
context_hook = gdbtk_context_change;
static void
gdbtk_flush (stream)
- FILE *stream;
+ GDB_FILE *stream;
{
#if 0
/* Force immediate screen update */
* We place the data into the result_ptr, either as a string,
* or a list, depending whether the GDBTK_MAKES_LIST bit is set.
* 3) The GDBTK_TO_RESULT flag is unset - We route the data to gdbtk_tcl_fputs
- * UNLESS it was coming to stderr. Then we place it in the result_ptr
+ * UNLESS it was coming to gdb_stderr. Then we place it in the result_ptr
* anyway, so it can be dealt with.
*
*/
void
gdbtk_fputs (ptr, stream)
const char *ptr;
- FILE *stream;
+ GDB_FILE *stream;
{
in_fputs = 1;
static void
tk_command_loop ()
{
- extern GDB_FILE *instream;
+ extern FILE *instream;
/* We no longer want to use stdin as the command input stream */
instream = NULL;
in_x_event = 1;
-#ifdef __CYGWIN32__
+#ifdef __CYGWIN__
if (signo == -2)
gdbtk_stop_timer ();
#endif
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.*/
-
- if (!strcmp(cmdblk->name, "tstart") && !No_Update)
- {
- 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");
- }
+ 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);
if (filename == NULL)
filename = "";
- sprintf (buf, "gdbtk_tcl_breakpoint %s %d 0x%lx %d {%s}", action, b->number,
- (long)b->address, b->line_number, filename);
+ sprintf (buf, "gdbtk_tcl_breakpoint %s %d 0x%lx %d {%s} {%s} %d %d",
+ action, b->number, (long)b->address, b->line_number, filename,
+ bpdisp[b->disposition], b->enable, b->thread);
v = Tcl_Eval (gdbtk_interp, buf);
}
}
+/*
+ * gdbtk_trace_find
+ *
+ * This is run by the trace_find_command. arg is the argument that was passed
+ * to that command, from_tty is 1 if the command was run from a tty, 0 if it
+ * was run from a script. It runs gdbtk_tcl_tfind_hook passing on these two
+ * arguments.
+ *
+ */
+
+static void
+gdbtk_trace_find (arg, from_tty)
+ char *arg;
+ int from_tty;
+{
+ Tcl_Obj *cmdObj;
+
+ if (from_tty) {
+ Tcl_GlobalEval (gdbtk_interp, "debug {*** In gdbtk_trace_find, from_tty is true}");
+ cmdObj = Tcl_NewListObj (0, NULL);
+ Tcl_ListObjAppendElement (gdbtk_interp, cmdObj,
+ Tcl_NewStringObj ("gdbtk_tcl_trace_find_hook", -1));
+ Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewStringObj (arg, -1));
+ Tcl_ListObjAppendElement (gdbtk_interp, cmdObj, Tcl_NewIntObj(from_tty));
+ Tcl_GlobalEvalObj (gdbtk_interp, cmdObj);
+ } else {
+ Tcl_GlobalEval (gdbtk_interp, "debug {*** In gdbtk_trace_find, from_tty is false}");
+ }
+}
+
+/*
+ * gdbtk_trace_start_stop
+ *
+ * This is run by the trace_start_command and trace_stop_command.
+ * The START variable determines which, 1 meaning trace_start was run,
+ * 0 meaning trace_stop was run.
+ *
+ */
+
+static void
+gdbtk_trace_start_stop (start, from_tty)
+ int start;
+ int from_tty;
+{
+ Tcl_Obj *cmdObj;
+
+ if (from_tty) {
+ Tcl_GlobalEval (gdbtk_interp, "debug {*** In gdbtk_trace_start, from_tty is true}");
+ cmdObj = Tcl_NewListObj (0, NULL);
+ if (start)
+ Tcl_ListObjAppendElement (gdbtk_interp, cmdObj,
+ Tcl_NewStringObj ("gdbtk_tcl_tstart", -1));
+ else
+ Tcl_ListObjAppendElement (gdbtk_interp, cmdObj,
+ Tcl_NewStringObj ("gdbtk_tcl_tstop", -1));
+ Tcl_GlobalEvalObj (gdbtk_interp, cmdObj);
+ } else {
+ Tcl_GlobalEval (gdbtk_interp, "debug {*** In gdbtk_trace_startd, from_tty is false}");
+ }
+
+}
+
static void
gdbtk_selected_frame_changed (level)
int level;
{
gdb_context = num;
}
+
+/* Called from file_command */
+static void
+gdbtk_file_changed (filename)
+ char *filename;
+{
+ gdbtk_two_elem_cmd ("gdbtk_tcl_file_changed", filename);
+}
+
+/* Called from exec_file_command */
+static void
+gdbtk_exec_file_display (filename)
+ char *filename;
+{
+ gdbtk_two_elem_cmd ("gdbtk_tcl_exec_file_display", filename);
+}