From patchwork Mon Mar 21 15:21:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 11441 Received: (qmail 129551 invoked by alias); 21 Mar 2016 15:29:41 -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 129409 invoked by uid 89); 21 Mar 2016 15:29:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 spammy=996, 1476 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:29:35 +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 F23EA7F6A2 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 u2LFLGPd019569 for ; Mon, 21 Mar 2016 11:21:28 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 11/25] Make current_ui_out be per UI Date: Mon, 21 Mar 2016 15:21:01 +0000 Message-Id: <1458573675-15478-12-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> Similarly to gdb_stdout&co. --- gdb/top.c | 1 + gdb/top.h | 3 +++ gdb/ui-out.c | 5 ----- gdb/ui-out.h | 3 ++- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/top.c b/gdb/top.c index 4ecc99d..0d8a18a 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -99,6 +99,7 @@ gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdout) gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdin) gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stderr) gen_ret_current_ui_field_ptr (struct ui_file *, gdb_stdlog) +gen_ret_current_ui_field_ptr (struct ui_out *, current_uiout) /* Initialization file name for gdb. This is host-dependent. */ diff --git a/gdb/top.h b/gdb/top.h index 2c4c9f1..a763f36 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -97,6 +97,9 @@ struct ui *_unfiltered. In the very near future that restriction shall be removed - either call shall be unfiltered. (cagney 1999-06-13). */ struct ui_file *m_gdb_stdlog; + + /* The current ui_out. */ + struct ui_out *m_current_uiout; }; extern struct ui *main_ui; diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 4ea571b..3972a56 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -147,11 +147,6 @@ pop_level (struct ui_out *uiout, return uiout->level + 1; } -/* FIXME: This should not be a global, but something passed down from main.c - or top.c. */ - -struct ui_out *current_uiout = NULL; - /* These are the interfaces to implementation functions. */ static void uo_table_begin (struct ui_out *uiout, int nbrofcols, diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 905d73c..9e1e74d 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -32,7 +32,8 @@ struct ui_file; /* FIXME: This should not be a global but something passed down from main.c or top.c. */ -extern struct ui_out *current_uiout; +extern struct ui_out **current_ui_current_uiout_ptr (void); +#define current_uiout (*current_ui_current_uiout_ptr ()) /* alignment enum */ enum ui_align