From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10992 invoked by alias); 21 Aug 2013 18:09:21 -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 10971 invoked by uid 89); 21 Aug 2013 18:09:20 -0000 X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD autolearn=ham version=3.3.2 Received: from mms3.broadcom.com (HELO mms3.broadcom.com) (216.31.210.19) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 21 Aug 2013 18:09:19 +0000 Received: from [10.9.208.53] by mms3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.5)); Wed, 21 Aug 2013 10:59:06 -0700 X-Server-Uuid: B86B6450-0931-4310-942E-F00ED04CA7AF Received: from IRVEXCHSMTP3.corp.ad.broadcom.com (10.9.207.53) by IRVEXCHCAS06.corp.ad.broadcom.com (10.9.208.53) with Microsoft SMTP Server (TLS) id 14.1.438.0; Wed, 21 Aug 2013 11:09:15 -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, 21 Aug 2013 11:09:15 -0700 Received: from [10.177.73.49] (unknown [10.177.73.49]) by mail-irva-13.broadcom.com (Postfix) with ESMTP id C1CA3F2D72 for ; Wed, 21 Aug 2013 11:09:14 -0700 (PDT) Message-ID: <5215024A.9080709@broadcom.com> Date: Wed, 21 Aug 2013 18:09: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: "gdb-patches@sourceware.org" Subject: [PATCH] Remove deprecated_command_loop_hook Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-08/txt/msg00605.txt.bz2 Small patch to remove deprecated_command_loop_hook. OK to apply? Thanks, Andrew gdb/ChangeLog 2013-08-21 Andrew Burgess * defs.h (deprecated_command_loop_hook): Remove, and remove reference in comment. * interps.c (current_interp_command_loop): Remove use of deprecated_command_loop_hook. (clear_interpreter_hooks): Same. * mi/mi-common.h (struct mi_interp): Add mi version number. * mi/mi-interp.c (mi_command_loop): Change signature, pull version number from cookie. (mi1_command_loop): Delete. (mi2_command_loop): Delete. (mi3_command_loop): Delete. (mi_interpreter_init): Add the mi version to the data cookie. (mi_interoreter_resume): Remove use of deprecated_command_loop_hook. (_initialize_mi_interp): Add mi_command_loop to interpreter procs. * top.c (deprecated_command_loop_hook): Remove. diff --git a/gdb/defs.h b/gdb/defs.h index 014d7d4..6117b00 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -702,10 +702,8 @@ extern int watchdog; extern char *interpreter_p; /* If a given interpreter matches INTERPRETER_P then it should update - deprecated_command_loop_hook and deprecated_init_ui_hook with the - per-interpreter implementation. */ -/* FIXME: deprecated_command_loop_hook and deprecated_init_ui_hook - should be moved here. */ + deprecated_init_ui_hook with the per-interpreter implementation. */ +/* FIXME: deprecated_init_ui_hook should be moved here. */ struct target_waitstatus; struct cmd_list_element; @@ -715,7 +713,6 @@ extern void (*deprecated_post_add_symbol_hook) (void); extern void (*selected_frame_level_changed_hook) (int); extern int (*deprecated_ui_loop_hook) (int signo); extern void (*deprecated_init_ui_hook) (char *argv0); -extern void (*deprecated_command_loop_hook) (void); extern void (*deprecated_show_load_progress) (const char *section, unsigned long section_sent, unsigned long section_size, diff --git a/gdb/interps.c b/gdb/interps.c index 25500d6..33e0f72 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -320,12 +320,9 @@ void current_interp_command_loop (void) { /* Somewhat messy. For the moment prop up all the old ways of - selecting the command loop. `deprecated_command_loop_hook' - should be deprecated. */ - if (deprecated_command_loop_hook != NULL) - deprecated_command_loop_hook (); - else if (current_interpreter != NULL - && current_interpreter->procs->command_loop_proc != NULL) + selecting the command loop. */ + if (current_interpreter != NULL + && current_interpreter->procs->command_loop_proc != NULL) current_interpreter->procs->command_loop_proc (current_interpreter->data); else cli_command_loop (); @@ -386,7 +383,6 @@ clear_interpreter_hooks (void) deprecated_target_wait_hook = 0; deprecated_call_command_hook = 0; deprecated_error_begin_hook = 0; - deprecated_command_loop_hook = 0; } /* This is a lazy init routine, called the first time the interpreter diff --git a/gdb/mi/mi-common.h b/gdb/mi/mi-common.h index 3590897..a3b48bc 100644 --- a/gdb/mi/mi-common.h +++ b/gdb/mi/mi-common.h @@ -60,6 +60,9 @@ struct mi_interp /* MI's builder. */ struct ui_out *uiout; + /* The version of the mi we're running. */ + int version; + /* This is the interpreter for the mi... */ struct interp *mi2_interp; struct interp *mi1_interp; diff --git a/gdb/mi/mi-interp.c b/gdb/mi/mi-interp.c index e370a57..aaf2869 100644 --- a/gdb/mi/mi-interp.c +++ b/gdb/mi/mi-interp.c @@ -43,7 +43,7 @@ static void mi_execute_command_wrapper (const char *cmd); static void mi_execute_command_input_handler (char *cmd); -static void mi_command_loop (int mi_version); +static void mi_command_loop (void *data); /* These are hooks that we put in place while doing interpreter_exec so we can report interesting things that happened "behind the MI's @@ -52,10 +52,6 @@ static void mi_command_loop (int mi_version); static int mi_interp_query_hook (const char *ctlstr, va_list ap) ATTRIBUTE_PRINTF (1, 0); -static void mi3_command_loop (void); -static void mi2_command_loop (void); -static void mi1_command_loop (void); - 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; -static void -mi_command_loop (int mi_version) -{ /* Turn off 8 bit strings in quoted output. Any character with the high bit set is printed using C's octal format. */ sevenbit_strings = 1; @@ -996,7 +966,8 @@ _initialize_mi_interp (void) mi_interpreter_exec, /* exec_proc */ mi_interpreter_prompt_p, /* prompt_proc_p */ mi_ui_out, /* ui_out_proc */ - mi_set_logging /* set_logging_proc */ + mi_set_logging, /* set_logging_proc */ + mi_command_loop /* command_loop_proc */ }; /* The various interpreter levels. */ diff --git a/gdb/top.c b/gdb/top.c index 516ffb9..95ee462 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -199,12 +199,6 @@ void (*deprecated_init_ui_hook) (char *argv0); int (*deprecated_ui_loop_hook) (int); -/* Called instead of command_loop at top level. Can be invoked via - throw_exception(). */ - -void (*deprecated_command_loop_hook) (void); - - /* Called from print_frame_info to list the line we stopped in. */ void (*deprecated_print_frame_info_listing_hook) (struct symtab * s,