forked from Imagelibrary/binutils-gdb
Highlight source code using GNU Source Highlight
This changes gdb to highlight source using GNU Source Highlight, if it is available. This affects the output of the "list" command and also the TUI source window. No new test because I didn't see a way to make it work when Source Highlight is not found. gdb/ChangeLog 2018-12-28 Tom Tromey <tom@tromey.com> * utils.h (can_emit_style_escape): Declare. * utils.c (can_emit_style_escape): No longer static. * cli/cli-style.c (set_style_enabled): New function. (_initialize_cli_style): Use it. * tui/tui-winsource.c (tui_show_source_line): Use tui_puts. (tui_alloc_source_buffer): Change how source lines are allocated. * tui/tui-source.c (copy_source_line): New function. (tui_set_source_content): Use source cache. * tui/tui-io.h (tui_puts): Update. * tui/tui-io.c (tui_puts_internal): Add window parameter. (tui_puts): Likewise. (tui_redisplay_readline): Update. * tui/tui-data.c (free_content_elements): Change how source window contents are freed. * source.c (forget_cached_source_info): Clear the source cache. (print_source_lines_base): Use the source cache. * source-cache.h: New file. * source-cache.c: New file. * configure.ac: Check for GNU Source Highlight library. * configure: Update. * config.in: Update. * Makefile.in (SRCHIGH_LIBS, SRCHIGH_CFLAGS): New variables. (INTERNAL_CFLAGS_BASE): Add SRCHIGH_CFLAGS. (CLIBS): Add SRCHIGH_LIBS. (COMMON_SFILES): Add source-cache.c. (HFILES_NO_SRCDIR): Add source-cache.h.
This commit is contained in:
30
gdb/configure
vendored
30
gdb/configure
vendored
@@ -701,6 +701,8 @@ ALLOCA
|
||||
LTLIBIPT
|
||||
LIBIPT
|
||||
HAVE_LIBIPT
|
||||
SRCHIGH_CFLAGS
|
||||
SRCHIGH_LIBS
|
||||
HAVE_GUILE_FALSE
|
||||
HAVE_GUILE_TRUE
|
||||
GUILE_LIBS
|
||||
@@ -11469,6 +11471,34 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# ---------------------------- #
|
||||
# Check for source highlight. #
|
||||
# ---------------------------- #
|
||||
|
||||
SRCHIGH_LIBS=
|
||||
SRCHIGH_CFLAGS=
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for source highlight" >&5
|
||||
$as_echo_n "checking for source highlight... " >&6; }
|
||||
if test "${pkg_config_prog_path}" = "missing"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no - pkg-config not found" >&5
|
||||
$as_echo "no - pkg-config not found" >&6; }
|
||||
else
|
||||
if ${pkg_config_prog_path} --exists source-highlight; then
|
||||
SRCHIGH_CFLAGS=`${pkg_config_prog_path} --cflags source-highlight`
|
||||
SRCHIGH_LIBS=`${pkg_config_prog_path} --libs source-highlight`
|
||||
|
||||
$as_echo "#define HAVE_SOURCE_HIGHLIGHT 1" >>confdefs.h
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# --------------------- #
|
||||
# Check for libmcheck. #
|
||||
# --------------------- #
|
||||
|
||||
Reference in New Issue
Block a user