Skip to content
Tcl Source Code View Ticket
Login

View Ticket

tcl_platform(debug) is not defined under UNIX

Closed / Out of Date219230ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 13 years ago
Descriptionplain2000-10-26 05:03:53
OriginalBugID: 4263 RFE
Version: 8.3
SubmitDate: '2000-02-28'
LastModified: '2000-03-01'
Severity: CRIT
Status: Assigned
Submitter: techsupp
ChangedBy: hobbs
OS: Linux-Red Hat
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'


Name:

mo


Comments:

This patch makes the UNIX build define tcl_platform(debug) just like

    the windows verison. I am not sure if this is the "right" way to do it,

    but it works.


ReproducibleScript:

When Tcl is compiled with the --enable-symbols flag, the tcl_platform(debug)

is not set. This same var is set under Windows when compiling with debug

on. Any script that looks for tcl_platform(debug) will break when run

under unix.


Patch:

Index: unix/tcl.m4

===================================================================

RCS file: /cvsroot/tcl/unix/tcl.m4,v

retrieving revision 1.20

diff -u -r1.20 tcl.m4

--- tcl.m42000/02/10 08:55:321.20

+++ tcl.m42000/02/28 21:24:51

@@ -575,7 +575,7 @@

     TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`'

     ECHO_VERSION='`echo ${VERSION}`'

     TCL_LIB_VERSIONS_OK=ok

-    CFLAGS_DEBUG=-g

+    CFLAGS_DEBUG="-g -D_DEBUG"

     CFLAGS_OPTIMIZE=-O

     if test "$using_gcc" = "yes" ; then

 CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"

Index: unix/tclUnixInit.c

===================================================================

RCS file: /cvsroot/tcl/unix/tclUnixInit.c,v

retrieving revision 1.18

diff -u -r1.18 tclUnixInit.c

--- tclUnixInit.c1999/10/13 00:32:491.18

+++ tclUnixInit.c2000/02/28 21:24:51

@@ -580,6 +580,18 @@

 Tcl_SetVar2(interp, "tcl_platform", "osVersion", "", TCL_GLOBAL_ONLY);

 Tcl_SetVar2(interp, "tcl_platform", "machine", "", TCL_GLOBAL_ONLY);

     }

+    

+#ifdef _DEBUG

+    /*

+     * The existence of the "debug" element of the tcl_platform array indicates

+     * that this particular Tcl shell has been compiled with debug information.

+     * Using "info exists tcl_platform(debug)" a Tcl script can direct the 

+     * interpreter to load debug versions of shared libs with the load command.

+     */

+

+    Tcl_SetVar2(interp, "tcl_platform", "debug", "1",

+    TCL_GLOBAL_ONLY);

+#endif


     /*

      * Copy USER or LOGNAME environment variable into tcl_platform(user)


PatchFiles:

unix/tclUnixInit.c

    unix/tcl.m4




It's noted under tclvars in the docs that tcl_platform(debug)
is only defined on Windows, so I've changed this to RFE. 
-- 03/01/2000 hobbs 
-- 03/01/2000 hobbs
dkf Ticket [219230ffff]: 2 changes [History diff]2001-02-07 22:51:19
dgp Ticket [219230ffff]: 1 change [History diff]2001-02-08 13:49:43
dgp Ticket [219230ffff]: 1 change [History diff]2001-04-04 04:21:55
davygrvyplain2002-11-27 09:39:49
Logged In: YES 
user_id=7549

Jeff, has this been changed in the recent TEA2 mods?
jan.nijtmansplain2013-07-02 12:59:53
TIP #59 now has another way to embed this kind of information
Log in (anonymous is fine) to add a comment.