diff options
Diffstat (limited to 'gdb/cli-out.c')
-rw-r--r-- | gdb/cli-out.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/gdb/cli-out.c b/gdb/cli-out.c index 7e3ee3e..4b5fc17 100644 --- a/gdb/cli-out.c +++ b/gdb/cli-out.c @@ -25,6 +25,7 @@ #include "cli-out.h" #include "completer.h" #include "readline/readline.h" +#include "cli/cli-style.h" /* These are the CLI output functions */ @@ -71,7 +72,8 @@ cli_ui_out::do_table_header (int width, ui_align alignment, if (m_suppress_output) return; - do_field_string (0, width, alignment, 0, col_hdr.c_str ()); + do_field_string (0, width, alignment, 0, col_hdr.c_str (), + ui_out_style_kind::DEFAULT); } /* Mark beginning of a list */ @@ -99,7 +101,8 @@ cli_ui_out::do_field_int (int fldno, int width, ui_align alignment, std::string str = string_printf ("%d", value); - do_field_string (fldno, width, alignment, fldname, str.c_str ()); + do_field_string (fldno, width, alignment, fldname, str.c_str (), + ui_out_style_kind::DEFAULT); } /* used to omit a field */ @@ -111,7 +114,8 @@ cli_ui_out::do_field_skip (int fldno, int width, ui_align alignment, if (m_suppress_output) return; - do_field_string (fldno, width, alignment, fldname, ""); + do_field_string (fldno, width, alignment, fldname, "", + ui_out_style_kind::DEFAULT); } /* other specific cli_field_* end up here so alignment and field @@ -119,7 +123,8 @@ cli_ui_out::do_field_skip (int fldno, int width, ui_align alignment, void cli_ui_out::do_field_string (int fldno, int width, ui_align align, - const char *fldname, const char *string) + const char *fldname, const char *string, + ui_out_style_kind style) { int before = 0; int after = 0; @@ -154,7 +159,25 @@ cli_ui_out::do_field_string (int fldno, int width, ui_align align, spaces (before); if (string) - fputs_filtered (string, m_streams.back ()); + { + ui_file_style fstyle; + switch (style) + { + case ui_out_style_kind::DEFAULT: + /* Nothing. */ + break; + case ui_out_style_kind::FILE: + /* Nothing. */ + fstyle = file_name_style.style (); + break; + case ui_out_style_kind::FUNCTION: + fstyle = function_name_style.style (); + break; + default: + gdb_assert_not_reached ("missing case"); + } + fputs_styled (string, fstyle, m_streams.back ()); + } if (after) spaces (after); @@ -175,7 +198,8 @@ cli_ui_out::do_field_fmt (int fldno, int width, ui_align align, std::string str = string_vprintf (format, args); - do_field_string (fldno, width, align, fldname, str.c_str ()); + do_field_string (fldno, width, align, fldname, str.c_str (), + ui_out_style_kind::DEFAULT); } void |