#include "target.h"
#include <tcl.h>
#include <tk.h>
+#ifdef ANSI_PROTOTYPES
+#include <stdarg.h>
+#else
#include <varargs.h>
+#endif
#include <signal.h>
#include <fcntl.h>
#include <unistd.h>
static int disassemble_from_exec = -1;
+/* Supply malloc calls for tcl/tk. */
+
+char *
+Tcl_Malloc (size)
+ unsigned int size;
+{
+ return xmalloc (size);
+}
+
+char *
+Tcl_Realloc (ptr, size)
+ char *ptr;
+ unsigned int size;
+{
+ return xrealloc (ptr, size);
+}
+
+void
+Tcl_Free(ptr)
+ char *ptr;
+{
+ free (ptr);
+}
+
static void
null_routine(arg)
int arg;
}
static int
-gdbtk_query (args)
+gdbtk_query (query, args)
+ char *query;
va_list args;
{
- char *query;
char buf[200];
long val;
- query = va_arg (args, char *);
-
vsprintf (buf, query, args);
Tcl_VarEval (interp, "gdbtk_tcl_query ", "{", buf, "}", NULL);
}
\f
static void
+#ifdef ANSI_PROTOTYPES
+dsprintf_append_element (Tcl_DString *dsp, char *format, ...)
+#else
dsprintf_append_element (va_alist)
va_dcl
+#endif
{
va_list args;
+ char buf[1024];
+
+#ifdef ANSI_PROTOTYPES
+ va_start (args, format);
+#else
Tcl_DString *dsp;
char *format;
- char buf[1024];
va_start (args);
-
dsp = va_arg (args, Tcl_DString *);
format = va_arg (args, char *);
+#endif
vsprintf (buf, format, args);