summaryrefslogtreecommitdiff
path: root/gcc/diagnostic.h
diff options
context:
space:
mode:
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2016-05-10 13:28:41 +0000
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>2016-05-10 13:28:41 +0000
commitabf93a25eaaf3b72cefe41565f6cd319dbffcc4b (patch)
tree557298bb7e615c65911ed2e91a38c03f905fba25 /gcc/diagnostic.h
parentd614888fe6325468e4999d4f077f13f0ae836fb4 (diff)
downloadgcc-abf93a25eaaf3b72cefe41565f6cd319dbffcc4b.tar.gz
Add debugging ruler to diagnostic-show-locus.c
When debugging diagnostic-show-locus.c, it's invaluable to have a "ruler" showing column numbers. This patch adds in support via a new "show_ruler_p" flag within the diagnostic_context. There's no direct way for end-users to enable this, but plugins can enable it by setting the flag, so the plugin that tests the diagnostic subsystem uses this to verify that the ruler is correctly printed. gcc/ChangeLog: * diagnostic-show-locus.c (layout::layout): Call show_ruler if show_ruler_p was set on the context. (layout::show_ruler): New method. * diagnostic.h (struct diagnostic_context): Add field "show_ruler_p". gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic-test-show-locus-bw.c (test_very_wide_line): Add ruler to expected output. * gcc.dg/plugin/diagnostic-test-show-locus-color.c (test_very_wide_line): Likewise. * gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (test_show_locus): Within the handling of "test_very_wide_line", enable show_ruler_p on the diagnostic context. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@236080 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.h')
-rw-r--r--gcc/diagnostic.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h
index ff573577084..48ae50d6879 100644
--- a/gcc/diagnostic.h
+++ b/gcc/diagnostic.h
@@ -201,6 +201,10 @@ struct diagnostic_context
source code (to avoid e.g. colorizing just the first character in
a token, which would look strange). */
bool colorize_source_p;
+
+ /* Usable by plugins; if true, print a debugging ruler above the
+ source output. */
+ bool show_ruler_p;
};
static inline void