From b11485dae8764a26940696869b1bf05fdb5178b9 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Sat, 6 Feb 1999 01:50:46 +0000 Subject: 1999-02-05 James Ingham * Makefile.in: Add GDBTK_CFLAGS - this is now used to hold -fwritable-strings when compiling with Tk8.1. * configure.in: Add GDBTK_CFLAGS, set it to -fwritable-strings for Tcl/Tk8.1 & greater. * acinclude.m4: Move the rest of the defines to find Itcl, Itk & Tix from aclocal.m4 to here. * aclocal.m4: regenerate. * configure: regenerate. * gdbtk-hooks.c (x_event): Tcl_ObjGetVar2 was removed from Tcl8.1. Use Tcl_GetVar2 instead. * gdbtk-hooks.c (gdbtk_trace_find): Fix up call to Tcl_GlobalEvalObj for Tcl/Tk 8.1. * gdbtk-hooks.c (gdbtk_trace_start_stop): Call to Tcl_EvalObj was inefficient, replace with call to Tcl_GlobalEval. * gdbtk.c: Don't swap out the Tcl_Alloc calls in gdbtk.c. We took care of that in Tcl itself for 8.1. * gdbtk.c: Remove const from the script string since Tcl8.1 has taken to scribbling sentinals into strings passed to it again... * gdbtk-cmds.c (wrapped_call): Change declaration of 1st arg from char * to PTR to eliminate warning. * gdbtk-cmds.c (perror_with_name_wrapper): Ditto --- gdb/gdbtk.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'gdb/gdbtk.c') diff --git a/gdb/gdbtk.c b/gdb/gdbtk.c index 3e96505..eaa150e 100644 --- a/gdb/gdbtk.c +++ b/gdb/gdbtk.c @@ -133,17 +133,20 @@ static char *gdbtk_source_filename = NULL; /* Supply malloc calls for tcl/tk. We do not want to do this on Windows, because Tcl_Alloc is probably in a DLL which will not call - the mmalloc routines. */ + the mmalloc routines. + We also don't need to do it for Tcl/Tk8.1, since we locally changed the + allocator to use malloc & free. */ +#if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 0 char * -Tcl_Alloc (size) +TclpAlloc (size) unsigned int size; { return xmalloc (size); } char * -Tcl_Realloc (ptr, size) +TclpRealloc (ptr, size) char *ptr; unsigned int size; { @@ -151,11 +154,12 @@ Tcl_Realloc (ptr, size) } void -Tcl_Free(ptr) +TclpFree(ptr) char *ptr; { free (ptr); } +#endif /* TCL_VERSION == 8.0 */ #endif /* ! _WIN32 */ @@ -532,7 +536,7 @@ gdbtk_init ( argv0 ) { #ifdef NO_TCLPRO_DEBUGGER - static const char script[] ="\ + static char script[] ="\ proc gdbtk_find_main {} {\n\ global Paths GDBTK_LIBRARY\n\ rename gdbtk_find_main {}\n\ @@ -541,7 +545,7 @@ proc gdbtk_find_main {} {\n\ }\n\ gdbtk_find_main"; #else - static const char script[] ="\ + static char script[] ="\ proc gdbtk_find_main {} {\n\ global Paths GDBTK_LIBRARY env\n\ rename gdbtk_find_main {}\n\ -- cgit v1.1