]> Git Repo - binutils.git/blobdiff - gdb/gdbtk.c
* read.c (potable): Add "mri" and ".mri".
[binutils.git] / gdb / gdbtk.c
index 882221d9658458ef7bfa9d4720133fbc757edd5f..31903f24553bd0ca4067fb371462729def79898e 100644 (file)
@@ -1,5 +1,5 @@
 /* Tcl/Tk interface routines.
-   Copyright 1994, 1995 Free Software Foundation, Inc.
+   Copyright 1994, 1995, 1996 Free Software Foundation, Inc.
 
    Written by Stu Grossman <[email protected]> of Cygnus Support.
 
@@ -17,7 +17,7 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
 #include "defs.h"
 #include "symtab.h"
@@ -153,11 +153,16 @@ gdbtk_query (query, args)
      char *query;
      va_list args;
 {
-  char buf[200];
+  char buf[200], *merge[2];
+  char *command;
   long val;
 
   vsprintf (buf, query, args);
-  Tcl_VarEval (interp, "gdbtk_tcl_query ", "{", buf, "}", NULL);
+  merge[0] = "gdbtk_tcl_query";
+  merge[1] = buf;
+  command = Tcl_Merge (2, merge);
+  Tcl_Eval (interp, command);
+  free (command);
 
   val = atol (interp->result);
   return val;
@@ -277,6 +282,8 @@ breakpoint_notify(b, action)
   if (b->type != bp_breakpoint)
     return;
 
+  /* We ensure that ACTION contains no special Tcl characters, so we
+     can do this.  */
   sprintf (buf, "gdbtk_tcl_breakpoint %s %d", action, b->number);
 
   v = Tcl_Eval (interp, buf);
@@ -680,7 +687,7 @@ call_wrapper (clientData, interp, argc, argv)
 /* In case of an error, we may need to force the GUI into idle mode because
    gdbtk_call_command may have bombed out while in the command routine.  */
 
-      Tcl_VarEval (interp, "gdbtk_tcl_idle", NULL);
+      Tcl_Eval (interp, "gdbtk_tcl_idle");
     }
 
   do_cleanups (ALL_CLEANUPS);
@@ -789,16 +796,17 @@ gdb_disassemble (clientData, interp, argc, argv)
 {
   CORE_ADDR pc, low, high;
   int mixed_source_and_assembly;
-  static disassemble_info di = {
-    (fprintf_ftype) fprintf_filtered, /* fprintf_func */
-    gdb_stdout,                        /* stream */
-    NULL,                      /* application_data */
-    0,                         /* flags */
-    NULL,                      /* private_data */
-    NULL,                      /* read_memory_func */
-    dis_asm_memory_error,      /* memory_error_func */
-    dis_asm_print_address      /* print_address_func */
-    };
+  static disassemble_info di;
+  static int di_initialized;
+
+  if (! di_initialized)
+    {
+      INIT_DISASSEMBLE_INFO (di, gdb_stdout,
+                            (fprintf_ftype) fprintf_unfiltered);
+      di.memory_error_func = dis_asm_memory_error;
+      di.print_address_func = dis_asm_print_address;
+      di_initialized = 1;
+    }
 
   if (argc != 3 && argc != 4)
     error ("wrong # args");
@@ -1068,9 +1076,9 @@ gdbtk_call_command (cmdblk, arg, from_tty)
 {
   if (cmdblk->class == class_run)
     {
-      Tcl_VarEval (interp, "gdbtk_tcl_busy", NULL);
+      Tcl_Eval (interp, "gdbtk_tcl_busy");
       (*cmdblk->function.cfunc)(arg, from_tty);
-      Tcl_VarEval (interp, "gdbtk_tcl_idle", NULL);
+      Tcl_Eval (interp, "gdbtk_tcl_idle");
     }
   else
     (*cmdblk->function.cfunc)(arg, from_tty);
This page took 0.024889 seconds and 4 git commands to generate.