diff options
author | Andrew Burgess <aburgess@redhat.com> | 2025-02-17 15:00:52 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2025-03-17 16:59:13 +0000 |
commit | a6924ac89d75188cd9ad3b740226db11798520dd (patch) | |
tree | 1a0d8fb1db817db29cd0f82c9c968ef83b68277a /gdb/ui-file.c | |
parent | 050c30f4db42d715d45c7dfcf40d85378945ec0a (diff) | |
download | binutils-a6924ac89d75188cd9ad3b740226db11798520dd.zip binutils-a6924ac89d75188cd9ad3b740226db11798520dd.tar.gz binutils-a6924ac89d75188cd9ad3b740226db11798520dd.tar.bz2 |
gdb: make cli_styling static within cli/cli-style.c
The cli_styling variable is controlled by 'set style enabled on|off'
user setting, and is currently globally visible.
In a couple of places we access this variable directly, though in
ui-file.c the accesses are all performed through term_cli_styling(),
which is a function that wraps checking cli_styling along with a check
that GDB's terminal supports styling.
In a future commit, I'd plan to add a new parameter to gdb.execute()
which will allow styling to be temporarily suppressed. In an earlier
proposal, I made gdb.execute() disable styling by changing the value
of cli_styling, however, this approach has a problem.
If gdb.execute() is used to run 'show style enabled', the changing
cli_styling will change what is printed. Similarly, if gdb.execute()
is used to execute 'set style enabled on|off' then having
gdb.execute() save and restore the value of cli_styling will undo the
adjustment from 'set style enabled ...'.
So what I plan to do in the future, is add a new control flag which
can be used to temporarily disable styling.
To make this new control variable easier to add, lets force everyone
to call term_cli_styling() to check if styling is enabled or not. To
force everyone to use term_cli_styling() this commit makes cli_styling
static within gdb/cli/cli-style.c.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/ui-file.c')
-rw-r--r-- | gdb/ui-file.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/gdb/ui-file.c b/gdb/ui-file.c index 1a2f5635..e9d3a90 100644 --- a/gdb/ui-file.c +++ b/gdb/ui-file.c @@ -180,16 +180,6 @@ null_file::write_async_safe (const char *buf, long sizeof_buf) -/* Return true if styling is currently enabled. */ - -static bool -term_cli_styling () -{ - return cli_styling; -} - - - string_file::~string_file () {} |