From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122274 invoked by alias); 16 Nov 2016 23:58:36 -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 122265 invoked by uid 89); 16 Nov 2016 23:58:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Nov 2016 23:58:34 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id AFFBF116A78; Wed, 16 Nov 2016 18:58:32 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xEk9M8Sztm6w; Wed, 16 Nov 2016 18:58:32 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7E988116A42; Wed, 16 Nov 2016 18:58:32 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 0AB5A42443; Wed, 16 Nov 2016 15:58:31 -0800 (PST) Date: Wed, 16 Nov 2016 23:58:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/tracepoint.c: Don't use printf_vma Message-ID: <20161116235831.GA4132@adacore.com> References: <1479251441-16443-1-git-send-email-palves@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479251441-16443-1-git-send-email-palves@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2016-11/txt/msg00468.txt.bz2 > I noticed that bfd's printf_vma prints to stdout directly: > > bfd-in2.h:202:#define printf_vma(x) fprintf_vma(stdout,x) > > This is a bad idea in gdb, where we should use > gdb_stdout/gdb_stderr/gdb_stdlog, etc., to support redirection. > > Eliminate uses of sprintf_vma too while at it. > > Tested on Fedora 23, w/ gdbserver. > > gdb/ChangeLog: > yyyy-mm-dd Pedro Alves > > * tracepoint.c (collection_list::add_memrange): Add gdbarch > parameter. Use paddress instead of printf_vma. Adjust recursive > calls. > (collection_list::stringify): Use paddress and phex_nz instead of > sprintf_vma. Adjust add_memrange call. > * tracepoint.h (collection_list::add_memrange): Declare new method. How about adding an ARI rule for those? I think it would help avoid this function creeping back in. It's not very difficult, and I might be able to find some time this weekend to take care of it. -- Joel