From patchwork Mon Mar 21 15:21:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 11432 Received: (qmail 108531 invoked by alias); 21 Mar 2016 15:26:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 108516 invoked by uid 89); 21 Mar 2016 15:26:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=gdbout X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 21 Mar 2016 15:26:28 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 339FC8F4F9 for ; Mon, 21 Mar 2016 15:21:28 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2LFLGPc019569 for ; Mon, 21 Mar 2016 11:21:27 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 10/25] Delete def_uiout Date: Mon, 21 Mar 2016 15:21:00 +0000 Message-Id: <1458573675-15478-11-git-send-email-palves@redhat.com> In-Reply-To: <1458573675-15478-1-git-send-email-palves@redhat.com> References: <1458573675-15478-1-git-send-email-palves@redhat.com> Currently current_uiout starts out pointing to def_uiout, a dummy ui_out implementation. I noticed that since we create a replacement uiout early on, as soon as we create the interpreter, that we never actually use def_uiout. So this patch removes it. The proof that it works is that starting with current_uiout set to NULL does not crash. --- gdb/ui-out.c | 181 +---------------------------------------------------------- 1 file changed, 1 insertion(+), 180 deletions(-) diff --git a/gdb/ui-out.c b/gdb/ui-out.c index e5a2bf1..4ea571b 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -147,84 +147,10 @@ pop_level (struct ui_out *uiout, return uiout->level + 1; } - -/* These are the default implementation functions. */ - -static void default_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, const char *tblid); -static void default_table_body (struct ui_out *uiout); -static void default_table_end (struct ui_out *uiout); -static void default_table_header (struct ui_out *uiout, int width, - enum ui_align alig, const char *col_name, - const char *colhdr); -static void default_begin (struct ui_out *uiout, - enum ui_out_type type, - int level, const char *id); -static void default_end (struct ui_out *uiout, - enum ui_out_type type, - int level); -static void default_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, - const char *fldname, - int value); -static void default_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align alig, - const char *fldname); -static void default_field_string (struct ui_out *uiout, int fldno, int width, - enum ui_align align, - const char *fldname, - const char *string); -static void default_field_fmt (struct ui_out *uiout, int fldno, - int width, enum ui_align align, - const char *fldname, - const char *format, - va_list args) ATTRIBUTE_PRINTF (6, 0); -static void default_spaces (struct ui_out *uiout, int numspaces); -static void default_text (struct ui_out *uiout, const char *string); -static void default_message (struct ui_out *uiout, int verbosity, - const char *format, - va_list args) ATTRIBUTE_PRINTF (3, 0); -static void default_wrap_hint (struct ui_out *uiout, char *identstring); -static void default_flush (struct ui_out *uiout); -static void default_data_destroy (struct ui_out *uiout); - -/* This is the default ui-out implementation functions vector. */ - -const struct ui_out_impl default_ui_out_impl = -{ - default_table_begin, - default_table_body, - default_table_end, - default_table_header, - default_begin, - default_end, - default_field_int, - default_field_skip, - default_field_string, - default_field_fmt, - default_spaces, - default_text, - default_message, - default_wrap_hint, - default_flush, - NULL, /* redirect */ - default_data_destroy, - 0, /* Does not need MI hacks. */ -}; - -/* The default ui_out */ - -struct ui_out def_uiout = -{ - 0, /* flags */ - &default_ui_out_impl, /* impl */ -}; - -/* Pointer to current ui_out */ /* FIXME: This should not be a global, but something passed down from main.c or top.c. */ -struct ui_out *current_uiout = &def_uiout; +struct ui_out *current_uiout = NULL; /* These are the interfaces to implementation functions. */ @@ -652,111 +578,6 @@ ui_out_is_mi_like_p (struct ui_out *uiout) return uiout->impl->is_mi_like_p; } -/* Default gdb-out hook functions. */ - -static void -default_table_begin (struct ui_out *uiout, int nbrofcols, - int nr_rows, - const char *tblid) -{ -} - -static void -default_table_body (struct ui_out *uiout) -{ -} - -static void -default_table_end (struct ui_out *uiout) -{ -} - -static void -default_table_header (struct ui_out *uiout, int width, enum ui_align alignment, - const char *col_name, - const char *colhdr) -{ -} - -static void -default_begin (struct ui_out *uiout, - enum ui_out_type type, - int level, - const char *id) -{ -} - -static void -default_end (struct ui_out *uiout, - enum ui_out_type type, - int level) -{ -} - -static void -default_field_int (struct ui_out *uiout, int fldno, int width, - enum ui_align align, - const char *fldname, int value) -{ -} - -static void -default_field_skip (struct ui_out *uiout, int fldno, int width, - enum ui_align align, const char *fldname) -{ -} - -static void -default_field_string (struct ui_out *uiout, - int fldno, - int width, - enum ui_align align, - const char *fldname, - const char *string) -{ -} - -static void -default_field_fmt (struct ui_out *uiout, int fldno, int width, - enum ui_align align, - const char *fldname, - const char *format, - va_list args) -{ -} - -static void -default_spaces (struct ui_out *uiout, int numspaces) -{ -} - -static void -default_text (struct ui_out *uiout, const char *string) -{ -} - -static void -default_message (struct ui_out *uiout, int verbosity, - const char *format, - va_list args) -{ -} - -static void -default_wrap_hint (struct ui_out *uiout, char *identstring) -{ -} - -static void -default_flush (struct ui_out *uiout) -{ -} - -static void -default_data_destroy (struct ui_out *uiout) -{ -} - /* Interface to the implementation functions. */ void