aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/cli/cli-style.c20
-rw-r--r--gdb/cli/cli-style.h11
-rw-r--r--gdb/main.c2
-rw-r--r--gdb/tui/tui-wingeneral.c2
-rw-r--r--gdb/ui-file.c10
5 files changed, 28 insertions, 17 deletions
diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c
index 47f7d2e..3ca30a4 100644
--- a/gdb/cli/cli-style.c
+++ b/gdb/cli/cli-style.c
@@ -27,9 +27,9 @@
/* True if styling is enabled. */
#if defined (__MSDOS__)
-bool cli_styling = false;
+static bool cli_styling = false;
#else
-bool cli_styling = true;
+static bool cli_styling = true;
#endif
/* True if source styling is enabled. Note that this is only
@@ -81,6 +81,22 @@ terminal_supports_styling ()
/* See cli/cli-style.h. */
void
+disable_cli_styling ()
+{
+ cli_styling = false;
+}
+
+/* See cli/cli-style.h. */
+
+bool
+term_cli_styling ()
+{
+ return cli_styling;
+}
+
+/* See cli/cli-style.h. */
+
+void
disable_styling_from_environment ()
{
const char *no_color = getenv ("NO_COLOR");
diff --git a/gdb/cli/cli-style.h b/gdb/cli/cli-style.h
index 1fb89a3..18827ce 100644
--- a/gdb/cli/cli-style.h
+++ b/gdb/cli/cli-style.h
@@ -157,13 +157,18 @@ extern bool source_styling;
/* True if disassembler styling is enabled. */
extern bool disassembler_styling;
-/* True if styling is enabled. */
-extern bool cli_styling;
-
/* Check for environment variables that indicate styling should start as
disabled. If any are found then disable styling. Styling is never
enabled by this call. If styling was already disabled then it remains
disabled after this call. */
extern void disable_styling_from_environment ();
+/* Equivalent to 'set style enabled off'. Can be used during GDB's start
+ up if a command line option, or environment variable, indicates that
+ styling should be turned off. */
+extern void disable_cli_styling ();
+
+/* Return true styled output is currently enabled. */
+extern bool term_cli_styling ();
+
#endif /* GDB_CLI_CLI_STYLE_H */
diff --git a/gdb/main.c b/gdb/main.c
index 2545a157..27043b7 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -1027,7 +1027,7 @@ captured_main_1 (struct captured_main_args *context)
quiet = 1;
/* Disable all output styling when running in batch mode. */
- cli_styling = false;
+ disable_cli_styling ();
}
}
diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c
index 56e7abd..90fdaceb 100644
--- a/gdb/tui/tui-wingeneral.c
+++ b/gdb/tui/tui-wingeneral.c
@@ -80,7 +80,7 @@ box_win (struct tui_win_info *win_info,
/* tui_apply_style resets the style entirely, so be sure to call it
before applying ATTRS. */
- if (cli_styling)
+ if (term_cli_styling ())
tui_apply_style (win, (highlight_flag
? tui_active_border_style.style ()
: tui_border_style.style ()));
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 ()
{}