From patchwork Wed Aug 14 16:21:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34105 Received: (qmail 82704 invoked by alias); 14 Aug 2019 16:23:11 -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 82671 invoked by uid 89); 14 Aug 2019 16:23:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=128, 11 X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.12) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Aug 2019 16:23:09 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 5CCB3A9C164 for ; Wed, 14 Aug 2019 11:21:36 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id xw1ohHot72qH7xw1ohHBQh; Wed, 14 Aug 2019 11:21:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=kICipIcHRWItnRAKiboIpRzyRntEkpOsLmqfTOHPXzE=; b=QZ8uUcHvbz7we8bJLTIy06dLcp cfsaEf656ZgJdB7XmYzpJYa/6aBZrwWws6uS6f0G3alZT/hIzDuSQXIQQnD354HyuKofhbqDUWudM jjVUQSXKt0XZMxHUd0IinkN5F; Received: from 97-122-178-82.hlrn.qwest.net ([97.122.178.82]:38600 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hxw1o-002Cwq-3G; Wed, 14 Aug 2019 11:21:36 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 04/15] Avoid string_file in tui_make_status_line Date: Wed, 14 Aug 2019 10:21:21 -0600 Message-Id: <20190814162132.31424-5-tom@tromey.com> In-Reply-To: <20190814162132.31424-1-tom@tromey.com> References: <20190814162132.31424-1-tom@tromey.com> tui_make_status_line uses string_file where a simple std::string constructor would do. This makes this change. gdb/ChangeLog 2019-08-14 Tom Tromey * tui/tui-stack.c (tui_make_status_line): Use string constructor. --- gdb/ChangeLog | 4 ++++ gdb/tui/tui-stack.c | 8 +++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index c67ac1ba549..1d7491dff93 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -128,11 +128,9 @@ tui_make_status_line (struct tui_locator_window *loc) line_width = MIN_LINE_WIDTH; /* Translate PC address. */ - string_file pc_out; - - fputs_filtered (loc->gdbarch? paddress (loc->gdbarch, loc->addr) : "??", - &pc_out); - + std::string pc_out (loc->gdbarch + ? paddress (loc->gdbarch, loc->addr) + : "??"); const char *pc_buf = pc_out.c_str (); int pc_width = pc_out.size ();