From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15210 invoked by alias); 18 Sep 2013 13:45:38 -0000 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 Received: (qmail 15199 invoked by uid 89); 18 Sep 2013 13:45:38 -0000 Received: from mms1.broadcom.com (HELO mms1.broadcom.com) (216.31.210.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Sep 2013 13:45:38 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_40,RDNS_NONE autolearn=no version=3.3.2 X-HELO: mms1.broadcom.com Received: from [10.9.208.57] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Wed, 18 Sep 2013 06:41:28 -0700 X-Server-Uuid: 06151B78-6688-425E-9DE2-57CB27892261 Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS08.corp.ad.broadcom.com (10.9.208.57) with Microsoft SMTP Server (TLS) id 14.1.438.0; Wed, 18 Sep 2013 06:45:25 -0700 Received: from mail-irva-13.broadcom.com (10.10.10.20) by IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) with Microsoft SMTP Server id 14.1.438.0; Wed, 18 Sep 2013 06:45:25 -0700 Received: from [10.177.73.74] (unknown [10.177.73.74]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id A95D1246A3 for ; Wed, 18 Sep 2013 06:45:24 -0700 (PDT) Message-ID: <5239AE74.80100@broadcom.com> Date: Wed, 18 Sep 2013 13:45:00 -0000 From: "Andrew Burgess" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: insight@sourceware.org Subject: [PATCH] Remove use of deprecated_init_ui_hook Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-q3/txt/msg00042.txt.bz2 We currently use deprecated_init_ui_hook in order to get hold of argv0 that started up gdb (this is used in a call to Tcl_FindExecutable). This patch to gdb: https://sourceware.org/ml/gdb-patches/2013-09/msg00225.html adds a new function get_gdb_program_name () that allows direct access to argv0. The patch below switches to use the new function, and removes the use of deprecated_init_ui_hook. OK to apply? Thanks, Andrew 2013-09-18 Andrew Burgess * generic/gdbtk.c: Add include of "main.h". (gdbtk_init_1): Remove. (argv0): Remove. (_initialize_gdbtk): No longer set deprecated_init_ui_hook. (gdbtk_init): Use get_gdb_program_name function from main.h. diff -u -p -r1.56 gdbtk.c --- ./gdb/gdbtk/generic/gdbtk.c 23 Jul 2013 16:40:47 -0000 1.56 +++ ./gdb/gdbtk/generic/gdbtk.c 18 Sep 2013 13:38:51 -0000 @@ -31,6 +31,7 @@ #include "top.h" #include "annotate.h" #include "exceptions.h" +#include "main.h" #if defined(_WIN32) || defined(__CYGWIN__) #define WIN32_LEAN_AND_MEAN @@ -88,8 +89,6 @@ extern int Tktable_Init (Tcl_Interp * in void gdbtk_init (void); -static void gdbtk_init_1 (char *argv0); - void gdbtk_interactive (void); static void cleanup_init (void *ignore); @@ -122,8 +121,6 @@ int running_now; static char *gdbtk_source_filename = NULL; int gdbtk_disable_fputs = 1; - -static const char *argv0; #ifndef _WIN32 @@ -372,7 +369,7 @@ gdbtk_init (void) old_chain = make_cleanup (cleanup_init, 0); /* First init tcl and tk. */ - Tcl_FindExecutable (argv0); + Tcl_FindExecutable (get_gdb_program_name ()); gdbtk_interp = Tcl_CreateInterp (); #ifdef TCL_MEM_DEBUG @@ -664,13 +661,6 @@ gdbtk_find_main"; } } -static void -gdbtk_init_1 (char *arg0) -{ - argv0 = arg0; - deprecated_init_ui_hook = NULL; -} - /* gdbtk_test is used in main.c to validate the -tclcommand option to gdb, which sources in a file of tcl code after idle during the startup procedure. */ @@ -690,13 +680,11 @@ gdbtk_test (char *filename) void _initialize_gdbtk (void) { +#ifdef __CYGWIN__ /* Current_interpreter not set yet, so we must check if "interpreter_p" is set to "insight" to know if insight is GOING to run. */ - if (strcmp (interpreter_p, "insight") == 0) - deprecated_init_ui_hook = gdbtk_init_1; -#ifdef __CYGWIN__ - else + if (strcmp (interpreter_p, "insight") != 0) { DWORD ft = GetFileType (GetStdHandle (STD_INPUT_HANDLE));