Fix "list" when control characters are seen
authorTom Tromey <tromey@adacore.com>
Tue, 9 Apr 2019 18:52:46 +0000 (12:52 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 19 Apr 2019 19:09:58 +0000 (13:09 -0600)
commit014bc49bfcf15d53c65d956ed337ab3217431483
treec04464539fcfb59bd8d227c65a282e6b3b3333d6
parentbf9a7cea9c88de232f07151614562f81b52630a0
Fix "list" when control characters are seen

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.

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.
gdb/ChangeLog
gdb/source.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/list0.h