From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13087 invoked by alias); 19 Mar 2012 11:46:38 -0000 Received: (qmail 13075 invoked by uid 22791); 19 Mar 2012 11:46:35 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_00,TW_BT,TW_CP,TW_DB X-Spam-Check-By: sourceware.org Received: from outdoor.onevision.de (HELO outdoor.onevision.de) (212.77.172.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Mar 2012 11:46:08 +0000 Received: from sanders.onevision.de (moonrace [212.77.172.62]) by outdoor.onevision.de (8.14.3/8.13.7/ROSCH/DDB) with ESMTP id q2JBk1hR017058 for ; Mon, 19 Mar 2012 12:46:06 +0100 Received: from [192.168.5.32] ([192.168.5.32]) by sanders.onevision.de (Lotus Domino Release 8.5.1FP3) with ESMTP id 2012031912455615-119269 ; Mon, 19 Mar 2012 12:45:56 +0100 Message-ID: <4F671C73.2020308@onevision.com> Date: Mon, 19 Mar 2012 11:46:00 -0000 From: Roland Schwingel User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: insight@sourceware.org Subject: [PATCH] Remove deprecated access to tcl internal variables Content-Type: multipart/mixed; boundary="------------010506080802050901050406" Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2012-q1/txt/msg00023.txt.bz2 This is a multi-part message in MIME format. --------------010506080802050901050406 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-length: 688 Hi... Since tcl 8.6 access to some internal variables has been removed from the code. It was already deprecated since many years. Attached you find 2 patches replacing the deprecated stuff with the current official way. This is also backward compatible to insight's tcl 8.4 version checkin in to sourceware.org. Changelog: 2012-03-19 Roland Schwingel * generic/gdbtk.c: (gdbtk_init,tk_command): Replace deprecated access to tcl interpreter result string with Tcl_GetStringResult(). * generic/gdbtk-hooks.c (gdbtk_read,gdbtk_readline,gdbtk_load_hash) (gdbtk_query): Likewise Any comments? Is this ok? Roland --------------010506080802050901050406 Content-Transfer-Encoding: 7bit Content-Type: text/plain; name="tcl_compat_gdbtk.c.patch" Content-Disposition: attachment; filename="tcl_compat_gdbtk.c.patch" Content-length: 1580 --- gdbtk_orig/generic/gdbtk.c 2012-03-19 11:21:15.542232400 +0100 +++ gdbtk/generic/gdbtk.c 2012-03-19 11:23:12.099170600 +0100 @@ -494,17 +494,17 @@ make_final_cleanup (gdbtk_cleanup, NULL); if (Tcl_Init (gdbtk_interp) != TCL_OK) - error ("Tcl_Init failed: %s", gdbtk_interp->result); + error ("Tcl_Init failed: %s", Tcl_GetStringResult(gdbtk_interp)); /* Initialize the Paths variable. */ if (ide_initialize_paths (gdbtk_interp, "") != TCL_OK) - error ("ide_initialize_paths failed: %s", gdbtk_interp->result); + error ("ide_initialize_paths failed: %s", Tcl_GetStringResult(gdbtk_interp)); if (Tk_Init (gdbtk_interp) != TCL_OK) - error ("Tk_Init failed: %s", gdbtk_interp->result); + error ("Tk_Init failed: %s", Tcl_GetStringResult(gdbtk_interp)); if (Tktable_Init (gdbtk_interp) != TCL_OK) - error ("Tktable_Init failed: %s", gdbtk_interp->result); + error ("Tktable_Init failed: %s", Tcl_GetStringResult(gdbtk_interp)); Tcl_StaticPackage (gdbtk_interp, "Tktable", Tktable_Init, (Tcl_PackageInitProc *) NULL); @@ -560,7 +560,7 @@ if (Gdbtk_Init (gdbtk_interp) != TCL_OK) { - error ("Gdbtk_Init failed: %s", gdbtk_interp->result); + error ("Gdbtk_Init failed: %s", Tcl_GetStringResult(gdbtk_interp)); } Tcl_StaticPackage (gdbtk_interp, "Insight", Gdbtk_Init, NULL); @@ -740,7 +740,7 @@ retval = Tcl_Eval (gdbtk_interp, cmd); - result = xstrdup (gdbtk_interp->result); + result = xstrdup (Tcl_GetStringResult(gdbtk_interp)); old_chain = make_cleanup (free, result); --------------010506080802050901050406 Content-Transfer-Encoding: 7bit Content-Type: text/plain; name="tcl_compat_gdbtk-hooks.c.patch" Content-Disposition: attachment; filename="tcl_compat_gdbtk-hooks.c.patch" Content-length: 1494 --- gdbtk_orig/generic/gdbtk-hooks.c 2012-01-03 13:26:56.000000000 +0100 +++ gdbtk/generic/gdbtk-hooks.c 2012-03-05 11:47:03.340565000 +0100 @@ -254,17 +254,22 @@ { report_error (); actual_len = 0; + buf[0] = '\0'; + return 0; } else - actual_len = strlen (gdbtk_interp->result); + { + const char *tclResult = Tcl_GetStringResult(gdbtk_interp); + actual_len = strlen (tclResult); /* Truncate the string if it is too big for the caller's buffer. */ if (actual_len >= sizeof_buf) actual_len = sizeof_buf - 1; - memcpy (buf, gdbtk_interp->result, actual_len); + memcpy (buf,tclResult, actual_len); buf[actual_len] = '\0'; return actual_len; + } } else { @@ -507,11 +512,11 @@ if (result == TCL_OK) { - return (xstrdup (gdbtk_interp->result)); + return (xstrdup (Tcl_GetStringResult(gdbtk_interp))); } else { - gdbtk_fputs (gdbtk_interp->result, gdb_stdout); + gdbtk_fputs (Tcl_GetStringResult(gdbtk_interp), gdb_stdout); gdbtk_fputs ("\n", gdb_stdout); return (NULL); } @@ -635,7 +640,7 @@ report_error (); free(buf); - return atoi (gdbtk_interp->result); + return atoi (Tcl_GetStringResult(gdbtk_interp)); } @@ -689,7 +694,7 @@ gdbtk_two_elem_cmd ("gdbtk_tcl_query", buf); free(buf); - val = atol (gdbtk_interp->result); + val = atol (Tcl_GetStringResult(gdbtk_interp)); return val; } --------------010506080802050901050406--