binutils-gdb/gdb/testsuite/gdb.base/list0.h
Tom Tromey 62160ec954 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.

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 13:01:54 -06:00

38 lines
623 B
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* An include file that actually causes code to be generated in the including file. This is known to cause problems on some systems. */
extern void bar(int);
static void foo (int x)
/* !
! */
{
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
bar (x++);
}