Files
binutils-gdb/gdb/source-cache.c
Tom de Vries 62dfd02e30 [gdb/cli] Factor out try_source_highlight
Function source_cache::ensure contains some code using the GNU
source-highlight library.

The code is a sizable part of the function, and contains conditional
compilation in a slightly convoluted way:
...
       if (!already_styled)
 #endif /* HAVE_SOURCE_HIGHLIGHT */
       {
...

Fix this by factoring out the code into new function try_source_highlight,
such that:
- source_cache::ensure is easier to read, and
- the conditional compilation is at the level of the function body.

Tested on x86_64-linux.

Reviewed-By: Lancelot Six <lancelot.six@amd.com>
2023-10-17 11:38:06 +02:00

12 KiB