+2020-04-10 Tom de Vries <tdevries@suse.de>
+
+ PR cli/25808
+ * python/lib/gdb/__init__.py: Initialize lexer with stripnl=False.
+
2020-04-09 Simon Marchi <simon.marchi@polymtl.ca>
* MAINTAINERS (Global Maintainers): Add Tom de Vries.
def colorize(filename, contents):
# Don't want any errors.
try:
- lexer = lexers.get_lexer_for_filename(filename)
+ lexer = lexers.get_lexer_for_filename(filename, stripnl=False)
formatter = formatters.TerminalFormatter()
return highlight(contents, lexer, formatter)
except:
+2020-04-10 Tom de Vries <tdevries@suse.de>
+
+ PR cli/25808
+ * gdb.base/style.c: Add leading newlines.
+ * gdb.base/style.exp: Use gdb_get_line_number to get specific lines.
+ Check listing of main's one-line body.
+
2020-04-08 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (psymtabs_p): New proc.
+
+
+/* The leading newlines here are intentional, do not remove. They are used to
+ test that the source highlighter doesn't strip them. */
/* Copyright 2018-2020 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
return
}
+ # Check that the source highlighter has not stripped away the leading
+ # newlines.
+ set main_line [gdb_get_line_number "break here"]
+ gdb_test "list $main_line,$main_line" "return.*some_called_function.*"
+
gdb_test_no_output "set style enabled on"
set main_expr [style main function]
}
if {$test_macros} {
+ set macro_line [gdb_get_line_number "\#define SOME_MACRO"]
gdb_test "info macro SOME_MACRO" \
- "Defined at $base_file_expr:16\r\n#define SOME_MACRO 23"
+ "Defined at $base_file_expr:$macro_line\r\n#define SOME_MACRO 23"
}
set func [style some_called_function function]