gdb: Fix skip of `\r` before `\n` in source output
In this commit:
commit 62f29fda90
Date: Tue Oct 9 22:21:05 2018 -0600
Highlight source code using GNU Source Highlight
A bug was introduced such that when displaying source code from a file
with lines `\r\n` GDB would print `^M` at the end of each line.
This caused a regression on the test gdb.fortran/nested-funcs.exp,
which happens to have `\r\n` line endings.
gdb/ChangeLog:
* source.c (print_source_lines_base): Fix skip of '\r' if next
character is '\n'.
This commit is contained in:
parent
a9859e0172
commit
62ea19c100
|
@ -1,3 +1,8 @@
|
||||||
|
2019-01-08 Andrew Burgess <andrew.burgess@embecosm.com>
|
||||||
|
|
||||||
|
* source.c (print_source_lines_base): Fix skip of '\r' if next
|
||||||
|
character is '\n'.
|
||||||
|
|
||||||
2019-01-06 Tom Tromey <tom@tromey.com>
|
2019-01-06 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* c-exp.y (struct c_parse_state) <macro_original_text,
|
* c-exp.y (struct c_parse_state) <macro_original_text,
|
||||||
|
|
|
@ -1379,12 +1379,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline,
|
||||||
else if (c == '\r')
|
else if (c == '\r')
|
||||||
{
|
{
|
||||||
/* Skip a \r character, but only before a \n. */
|
/* Skip a \r character, but only before a \n. */
|
||||||
if (iter[1] == '\n')
|
if (*iter != '\n')
|
||||||
{
|
|
||||||
++iter;
|
|
||||||
c = '\n';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
printf_filtered ("^%c", c + 0100);
|
printf_filtered ("^%c", c + 0100);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue