From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9401 invoked by alias); 29 Aug 2013 14:34:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 9377 invoked by uid 89); 29 Aug 2013 14:34:53 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 29 Aug 2013 14:34:53 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7TEYou0009954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 29 Aug 2013 10:34:50 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7TEYn1i010265; Thu, 29 Aug 2013 10:34:50 -0400 Message-ID: <521F5C08.8030904@redhat.com> Date: Thu, 29 Aug 2013 14:34:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andrew Burgess CC: gdb-patches@sourceware.org Subject: Re: PING: [PATCH] Remove deprecated_command_loop_hook References: <5215024A.9080709@broadcom.com> <52150D68.6020006@earthlink.net> <521558B5.6070909@broadcom.com> <521F26CB.3070209@broadcom.com> In-Reply-To: <521F26CB.3070209@broadcom.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-08/txt/msg00872.txt.bz2 On 08/29/2013 11:47 AM, Andrew Burgess wrote: > Ping! > > I know the gdbtk patch has not yet been merged, but the patch I posted > for them is not huge, nor should it prove controversial, it's in the > same style as this patch for core gdb. I guess people were just waiting to hear if/when the gdbtk patch had been merged. But really we don't need to wait for that. Split out the MI part from the part that actually gets rid of deprecated_command_loop_hook, and resend the MI bits. Once both MI and the gdbtk patches are in, resend the deprecated_command_loop_hook bit saying "hey, there are no users left, let's just garbage collect this.". > > + /* The version of the mi we're running. */ > + int version; > + I may be missing something, as I don't see a need for this ... > static void mi_insert_notify_hooks (void); > static void mi_remove_notify_hooks (void); > static void mi_on_normal_stop (struct bpstats *bs, int print_frame); > @@ -89,7 +85,6 @@ mi_interpreter_init (struct interp *interp, int top_level) > { > struct mi_interp *mi = XMALLOC (struct mi_interp); > const char *name; > - int mi_version; > > /* Assign the output channel created at startup to its own global, > so that we can create a console channel that encapsulates and > @@ -110,17 +105,17 @@ mi_interpreter_init (struct interp *interp, int top_level) > /* INTERP_MI selects the most recent released version. "mi2" was > released as part of GDB 6.0. */ > if (strcmp (name, INTERP_MI) == 0) > - mi_version = 2; > + mi->version = 2; > else if (strcmp (name, INTERP_MI1) == 0) > - mi_version = 1; > + mi->version = 1; > else if (strcmp (name, INTERP_MI2) == 0) > - mi_version = 2; > + mi->version = 2; > else if (strcmp (name, INTERP_MI3) == 0) > - mi_version = 3; > + mi->version = 3; > else > gdb_assert_not_reached ("unhandled MI version"); > > - mi->uiout = mi_out_new (mi_version); > + mi->uiout = mi_out_new (mi->version); > > if (top_level) > { > @@ -193,16 +188,6 @@ mi_interpreter_resume (void *data) > > deprecated_show_load_progress = mi_load_progress; > > - /* If we're _the_ interpreter, take control. */ > - if (current_interp_named_p (INTERP_MI1)) > - deprecated_command_loop_hook = mi1_command_loop; > - else if (current_interp_named_p (INTERP_MI2)) > - deprecated_command_loop_hook = mi2_command_loop; > - else if (current_interp_named_p (INTERP_MI3)) > - deprecated_command_loop_hook = mi3_command_loop; > - else > - deprecated_command_loop_hook = mi2_command_loop; > - > return 1; > } > > @@ -322,26 +307,11 @@ mi_execute_command_input_handler (char *cmd) > } > > static void > -mi1_command_loop (void) > -{ > - mi_command_loop (1); > -} > - > -static void > -mi2_command_loop (void) > +mi_command_loop (void *data) > { > - mi_command_loop (2); > -} > - > -static void > -mi3_command_loop (void) > -{ > - mi_command_loop (3); > -} > + struct mi_interp *mi = data; > + int mi_version = mi->version; > ... given mi_command_loop actually does nothing with mi_version... If we actually need it for something, we can extract it from the interpreter's uiout, with mi_version(uiout). -- Pedro Alves