aboutsummaryrefslogtreecommitdiff
path: root/gdb/source-cache.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-03-08 13:54:07 -0700
committerTom Tromey <tromey@adacore.com>2019-03-14 05:47:11 -0600
commitd085f98901ccd6c9764b93d3983f3c7797addc4f (patch)
treebdd1be3d6e40f4b72782ae0db0da3fc80dfe93c2 /gdb/source-cache.c
parent6f11e6824e15bd40fe1e7b245a22865c6ef8c7bd (diff)
downloadgdb-d085f98901ccd6c9764b93d3983f3c7797addc4f.zip
gdb-d085f98901ccd6c9764b93d3983f3c7797addc4f.tar.gz
gdb-d085f98901ccd6c9764b93d3983f3c7797addc4f.tar.bz2
Add the "set style source" command
This adds "set style source" (and "show style source") commands. This gives the user control over whether source code is highlighted. gdb/ChangeLog 2019-03-14 Tom Tromey <tromey@adacore.com> * NEWS: Add item for "style sources" commands. * source-cache.c (source_cache::get_source_lines): Check source_styling. * cli/cli-style.c (source_styling): New global. (_initialize_cli_style): Add "style sources" commands. (show_style_sources): New function. * cli/cli-style.h (source_styling): Declare. gdb/doc/ChangeLog 2019-03-14 Tom Tromey <tromey@adacore.com> * gdb.texinfo (Output Styling): Document "set style source" and "show style source". gdb/testsuite/ChangeLog 2019-03-14 Tom Tromey <tromey@adacore.com> * gdb.base/style.exp: Add "set style sources" test.
Diffstat (limited to 'gdb/source-cache.c')
-rw-r--r--gdb/source-cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/source-cache.c b/gdb/source-cache.c
index 435de2a..3b15b3f 100644
--- a/gdb/source-cache.c
+++ b/gdb/source-cache.c
@@ -180,7 +180,7 @@ source_cache::get_source_lines (struct symtab *s, int first_line,
return false;
#ifdef HAVE_SOURCE_HIGHLIGHT
- if (can_emit_style_escape (gdb_stdout))
+ if (source_styling && can_emit_style_escape (gdb_stdout))
{
const char *fullname = symtab_to_fullname (s);