This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gdb/tracepoint.c: Don't use printf_vma


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]