]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Add a new logging_file implementation
authorTom Tromey <tom@tromey.com>
Sat, 6 Dec 2025 21:35:24 +0000 (15:35 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 9 Feb 2026 15:15:36 +0000 (08:15 -0700)
commitaed0772e66e921c235165480276600a7c7dfc048
tree6063e24a6681e178dfa4520c1d5891addf887017
parent0391f70c7d9d8cff7a2f651ba8b9b015d0e9ea5d
Add a new logging_file implementation

This adds a new logging_file subclass of ui_file.  This new subclass
handles the details of logging, by consulting the relevant globals.

I think a dependency on globals is warranted here, because the logging
settings themselves are global.

The idea of this approach is that rather than modifying the output
pipeline in response to logging commands, a logging_file will simply
always be in the pipeline, and will then react to the appropriate
settings.  ("Appropriate" because there are tests that the logger
doesn't immediately react to changes, so it captures settings at the
moment logging starts.)

The new code isn't actually used yet -- nothing in this patch
constructs a logging_file.  It's separate for easier review.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/cli/cli-logging.c
gdb/logging-file.h [new file with mode: 0644]