aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKeith Seitz <keiths@cygnus>1998-01-15 20:43:37 +0000
committerKeith Seitz <keiths@cygnus>1998-01-15 20:43:37 +0000
commit0422b59e836bc8382c2227f614a0c0f715253662 (patch)
tree29cc85dfd5fcb1303e8d2e53ddece0bac85b9e21 /gdb
parented3e2cfec298f2159407f5bff89681690a2da869 (diff)
downloadgdb-0422b59e836bc8382c2227f614a0c0f715253662.zip
gdb-0422b59e836bc8382c2227f614a0c0f715253662.tar.gz
gdb-0422b59e836bc8382c2227f614a0c0f715253662.tar.bz2
* gdbtk.c (gdb_immediate_command): New function which does not buffer an
y output. (Contrast to gdb_cmd.) (gdbtk_init): Install "gdb_immediate" command into interpreter.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog-gdbtk6
-rw-r--r--gdb/gdbtk.c33
2 files changed, 39 insertions, 0 deletions
diff --git a/gdb/ChangeLog-gdbtk b/gdb/ChangeLog-gdbtk
index 3b49301..a1c0486 100644
--- a/gdb/ChangeLog-gdbtk
+++ b/gdb/ChangeLog-gdbtk
@@ -1,3 +1,9 @@
+Thu Jan 15 12:42:28 1998 Keith Seitz <keiths@onions.cygnus.com>
+
+ * gdbtk.c (gdb_immediate_command): New function which does not buffer any
+ output. (Contrast to gdb_cmd.)
+ (gdbtk_init): Install "gdb_immediate" command into interpreter.
+
Wed Jan 14 16:38:44 1998 Keith Seitz <keiths@pizza.cygnus.com>
* configure.in (--enable-gdbtk): If tcl was built with --enable-shared,
diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c
index 1168f5b..c83ed35f 100644
--- a/gdb/gdbtk.c
+++ b/gdb/gdbtk.c
@@ -113,6 +113,7 @@ static int gdb_listfiles PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
static int gdb_listfuncs PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
static int call_wrapper PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
static int gdb_cmd PARAMS ((ClientData, Tcl_Interp *, int, char *argv[]));
+static int gdb_immediate_command PARAMS ((ClientData, Tcl_Interp *, int, char *argv[]));
static int gdb_fetch_registers PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
static void gdbtk_readline_end PARAMS ((void));
static int gdb_changed_register_list PARAMS ((ClientData, Tcl_Interp *, int, char *[]));
@@ -977,6 +978,36 @@ gdb_changed_register_list (clientData, interp, argc, argv)
return map_arg_registers (argc, argv, register_changed_p, NULL);
}
+/* This implements the tcl command "gdb_immediate", which does exactly
+ the same thing as gdb_cmd, except NONE of its outut is buffered. */
+static int
+gdb_immediate_command (clientData, interp, argc, argv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int argc;
+ char *argv[];
+{
+ Tcl_DString *save_ptr = NULL;
+
+ if (argc != 2)
+ error ("wrong # args");
+
+ if (running_now)
+ return TCL_OK;
+
+ Tcl_DStringAppend (result_ptr, "", -1);
+ save_ptr = result_ptr;
+ result_ptr = NULL;
+
+ execute_command (argv[1], 1);
+
+ bpstat_do_actions (&stop_bpstat);
+
+ result_ptr = save_ptr;
+
+ return TCL_OK;
+}
+
/* This implements the TCL command `gdb_cmd', which sends its argument into
the GDB command scanner. */
@@ -1851,6 +1882,8 @@ gdbtk_init ( argv0 )
#endif
Tcl_CreateCommand (interp, "gdb_cmd", call_wrapper, gdb_cmd, NULL);
+ Tcl_CreateCommand (interp, "gdb_immediate", call_wrapper,
+ gdb_immediate_command, NULL);
Tcl_CreateCommand (interp, "gdb_loc", call_wrapper, gdb_loc, NULL);
Tcl_CreateCommand (interp, "gdb_path_conv", call_wrapper, gdb_path_conv, NULL);
Tcl_CreateCommand (interp, "gdb_sourcelines", call_wrapper, gdb_sourcelines,