[PATCH 00/19] Simplify GDB output functions

John Baldwin jhb@FreeBSD.org
Sat Jan 22 17:40:17 GMT 2022


On 1/21/22 5:37 PM, Tom Tromey wrote:
> This series tries to untangle and simplify the GDB output functions.
> 
> By the end of this series, whether a particular bit of output goes
> through the filter will largely depend on the particular stream that
> is being written to.  This means that new code can be much simpler --
> there's no need to decide between using a _filtered or _unfiltered
> form of a function, and in fact, that distinction will no longer
> exist.  (Some unfiltered output is still needed, but only to
> gdb_stdout, and only via a single API.  New such cases should be
> rare.)
> 
> A few cleanups are still possible after this series goes in.  For
> example, ui-file.c could be broken up a bit, and the pager
> implementation should be moved out of utils.c.  I also have a couple
> of pager bug fixes that I will apply afterward.
> 
> This series is based on a couple of still-pending output series that
> I've already sent.  I'll probably check those in reasonably soon.
> 
> Regression tested on x86-64 Fedora 34.

I only skimmed the patches, but I like the idea in general.  I wasn't
previously really aware of when to use filtered vs unfiltered and
just depended on matching existing code in other targets, etc.  To
that end I appreciate making the "default" API clearer.  I do think
having to use 'gdb_*' for functions that would alias stdio is slightly
unfortunate, but I understand the reason and I don't have a
better naming suggestion (gdb_* is consistent with other things like
our local versions of STL types, etc. so is the best choice I think)

-- 
John Baldwin


More information about the Gdb-patches mailing list