aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/source-cache.c12
2 files changed, 12 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7057e37..39f917b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2019-09-19 Tom de Vries <tdevries@suse.de>
+
+ PR gdb/25009
+ * source-cache.c (source_cache::ensure): Catch exception thrown during
+ construction of the highlighter.
+
2019-09-18 Alan Modra <amodra@gmail.com>
* aarch64-linux-tdep.c, * arm-tdep.c, * auto-load.c,
diff --git a/gdb/source-cache.c b/gdb/source-cache.c
index 7a52ce9..1fe6da8 100644
--- a/gdb/source-cache.c
+++ b/gdb/source-cache.c
@@ -190,14 +190,14 @@ source_cache::ensure (struct symtab *s)
conditional compilation in source-cache.h. */
static srchilite::SourceHighlight *highlighter;
- if (highlighter == nullptr)
- {
- highlighter = new srchilite::SourceHighlight ("esc.outlang");
- highlighter->setStyleFile ("esc.style");
- }
-
try
{
+ if (highlighter == nullptr)
+ {
+ highlighter = new srchilite::SourceHighlight ("esc.outlang");
+ highlighter->setStyleFile ("esc.style");
+ }
+
std::istringstream input (contents);
std::ostringstream output;
highlighter->highlight (input, output, lang_name, fullname);