Fix timeout with maint print objfiles
authorLuis Machado <luis.machado@linaro.org>
Thu, 1 Apr 2021 20:00:43 +0000 (17:00 -0300)
committerLuis Machado <luis.machado@linaro.org>
Tue, 27 Apr 2021 23:42:07 +0000 (20:42 -0300)
commitb9f90c72ee69a31100a7b1b4106f192dde75debf
treea631f7f6cfa087618bfa73126e24e59db68f63ce
parent4b62a30d5b4dcb24e73c1369d8c0da3dc10a4146
Fix timeout with maint print objfiles

I'm seeing timeouts from gdb.rust/traits.exp when we attempt to print
things with "maint print objfiles".

This happens for two reasons:

1 - GDB does not explicitly split each entry into its own line, but rather
    relies on the terminal's width to insert line breaks.

2 - When running the GDB testsuite, such width may be unlimited, which will
    prevent GDB from inserting any line breaks.

As a result, the output may be too lengthy and will come in big lines.  Tweak
the support library to match the patterns line-by-line, which gives us more
time to match things. Also fix GDB's output to print one entry per line,
regardless of the terminal width.

A similar approach was used in another testcase using the same command (commit
eaeaf44cfdc9a4096a0dd52fa0606f29d4bfd48e). With the new line breaks, we don't
need a particular pattern, so clean up that test as well.

gdb/ChangeLog:

2021-04-27  Luis Machado  <luis.machado@linaro.org>

* psymtab.c (psymbol_functions::dump): Output newline.
* symmisc.c (dump_objfile): Likewise.

gdb/testsuite/ChangeLog:

2021-04-27  Luis Machado  <luis.machado@linaro.org>

* gdb.base/maint.exp: Drop a pattern that is not needed.
* lib/gdb.exp (readnow): Match line-by-line.
gdb/ChangeLog
gdb/psymtab.c
gdb/symmisc.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/maint.exp
gdb/testsuite/lib/gdb.exp
This page took 0.033272 seconds and 4 git commands to generate.