From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/tracepoint.c: Don't use printf_vma
Date: Thu, 17 Nov 2016 00:12:00 -0000 [thread overview]
Message-ID: <1a578b5a-608e-b75e-7a68-687bae3c1aa8@redhat.com> (raw)
In-Reply-To: <20161116235831.GA4132@adacore.com>
On 11/16/2016 11:58 PM, Joel Brobecker wrote:
>> 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 <palves@redhat.com>
>>
>> * 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.
Indeed, sounds like a good idea.
> It's not very difficult, and I might be able to find some time
> this weekend to take care of it.
Thanks!
--
Pedro Alves
next prev parent reply other threads:[~2016-11-17 0:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-15 23:10 Pedro Alves
2016-11-16 14:34 ` Luis Machado
2016-11-16 23:58 ` Joel Brobecker
2016-11-17 0:12 ` Pedro Alves [this message]
2016-11-19 18:43 ` [FYI/pushed] ARI: Add detection of printf_vma and sprintf_vma (was: "Re: [PATCH] gdb/tracepoint.c: Don't use printf_vma") Joel Brobecker
2016-11-17 0:46 ` [PATCH] gdb/tracepoint.c: Don't use printf_vma Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1a578b5a-608e-b75e-7a68-687bae3c1aa8@redhat.com \
--to=palves@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox