PR symtab/24423 points out that control characters in a source file
cause a hang in the "list" command, a regression introduced by the
styling changes.
This patch, from the PR, fixes the bug. I've included a minimal
change to the "list" test that exercises this code.
I recall that this bug was discussed on gdb-patches, and I thought
there was a patch there as well, but I was unable to find it.
gdb/ChangeLog
2019-04-19 Ilya Yu. Malakhov <malakhov@mcst.ru>
PR symtab/24423:
* source.c (print_source_lines_base): Advance "iter" when a
control character is seen.
gdb/testsuite/ChangeLog
2019-04-19 Tom Tromey <tromey@adacore.com>
PR symtab/24423:
* gdb.base/list0.h (foo): Add a control-l character.
+2019-04-19 Ilya Yu. Malakhov <malakhov@mcst.ru>
+
+ PR symtab/24423:
+ * source.c (print_source_lines_base): Advance "iter" when a
+ control character is seen.
+
2019-04-19 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli/cli-cmds.c (_initialize_cli_cmds): Move "shell" "!" alias
char c = *iter;
if (c == '\033' && skip_ansi_escape (iter, &skip_bytes))
iter += skip_bytes;
- else if (c < 040 && c != '\t')
+ else if (c >= 0 && c < 040 && c != '\t')
break;
else if (c == 0177)
break;
{
xsnprintf (buf, sizeof (buf), "^%c", *iter + 0100);
uiout->text (buf);
+ ++iter;
}
else if (*iter == 0177)
- uiout->text ("^?");
+ {
+ uiout->text ("^?");
+ ++iter;
+ }
}
uiout->text ("\n");
}
+2019-04-19 Tom Tromey <tromey@adacore.com>
+
+ PR symtab/24423:
+ * gdb.base/list0.h (foo): Add a control-l character.
+
2019-04-18 Tom de Vries <tdevries@suse.de>
PR gdb/24433
extern void bar(int);
static void foo (int x)
/* !
- !
+\f
! */
{
bar (x++);