From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124160 invoked by alias); 19 Oct 2016 01:12:37 -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 123859 invoked by uid 89); 19 Oct 2016 01:12:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=*string 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 ESMTP; Wed, 19 Oct 2016 01:12:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A81023F1EA for ; Wed, 19 Oct 2016 01:12:31 +0000 (UTC) Received: from cascais.lan (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9J1CJjh019701 for ; Tue, 18 Oct 2016 21:12:31 -0400 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH v2 12/31] Use ui_file_as_string in gdb/utils.c Date: Wed, 19 Oct 2016 01:12:00 -0000 Message-Id: <1476839539-8374-13-git-send-email-palves@redhat.com> In-Reply-To: <1476839539-8374-1-git-send-email-palves@redhat.com> References: <1476839539-8374-1-git-send-email-palves@redhat.com> X-SW-Source: 2016-10/txt/msg00526.txt.bz2 gdb/ChangeLog: yyyy-mm-yy Pedro Alves * utils.c (error_stream): Use ui_file_as_string and std::string. --- gdb/utils.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/utils.c b/gdb/utils.c index 71c0e00..6feeb4d 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -509,10 +509,9 @@ verror (const char *string, va_list args) void error_stream (struct ui_file *stream) { - char *message = ui_file_xstrdup (stream, NULL); + std::string message = ui_file_as_string (stream); - make_cleanup (xfree, message); - error (("%s"), message); + error (("%s"), message.c_str ()); } /* Emit a message and abort. */ -- 2.5.5