* [PATCH][gdb/testsuite] Prevent pagination in GDB_INTERNALFLAGS
@ 2020-10-26 9:01 Tom de Vries
2020-10-26 14:54 ` Simon Marchi via Gdb-patches
0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2020-10-26 9:01 UTC (permalink / raw)
To: gdb-patches
Hi,
When running test-case gdb.base/corefile.exp with target board readnow, we run
into:
...
Reading symbols from outputs/gdb.base/corefile/corefile...^M
Expanding full symbols from outputs/gdb.base/corefile/corefile...^M
[New LWP 2293]^M
Core was generated by `outputs/gdb.base/corefile/co'.^M
Program terminated with signal SIGABRT, Aborted.^M
--Type <RET> for more, q to quit, c to continue without paging--\
FAIL: gdb.base/corefile.exp: (timeout) starting with -core
...
In commit bd447abb24 "Make gdb.base/corefile.exp work on terminals with few
rows", pagination (in the same test-case) is prevented using:
...
set stty_init "rows 25 cols 80"
...
but this doesn't work in our case because using -readnow adds an extra line
"Expanding full symbols".
The test passes when increasing rows to 26. However, increasing the rows by
some n only fixes the problem for n lines, and things will break again if
somehow we end up with n + 1 lines.
Instead, fix this by setting heigth and width in INTERNAL_GDBFLAGS. This
solution was not chosen in commit bd447abb24 because it doesn't handle
pagination due to the introduction text. But it does handle the pagination
due to the extra "Expanding full symbols", and any other line printed during
and after file loading.
Tested on x86_64-linux, with and without readnow.
With -readnow, fixes these FAILs:
...
FAIL: gdb.base/corefile.exp: (timeout) starting with -core
FAIL: gdb.base/reread-readsym.exp: source reread-readsym.gdb 1 (timeout)
...
Any comments?
Thanks,
- Tom
[gdb/testsuite] Prevent pagination in GDB_INTERNALFLAGS
gdb/testsuite/ChangeLog:
2020-10-26 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (INTERNAL_GDBFLAGS): Set heigth and width.
---
gdb/testsuite/lib/gdb.exp | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index f53df59f18..197542eec3 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -124,7 +124,13 @@ set BUILD_DATA_DIRECTORY "[pwd]/../data-directory"
# INTERNAL_GDBFLAGS contains flags that the testsuite requires.
global INTERNAL_GDBFLAGS
if ![info exists INTERNAL_GDBFLAGS] {
- set INTERNAL_GDBFLAGS "-nw -nx -data-directory $BUILD_DATA_DIRECTORY"
+ set INTERNAL_GDBFLAGS \
+ [join [list \
+ "-nw" \
+ "-nx" \
+ "-data-directory $BUILD_DATA_DIRECTORY" \
+ {-iex "set height 0"} \
+ {-iex "set width 0"}]]
}
# The variable gdb_prompt is a regexp which matches the gdb prompt.
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH][gdb/testsuite] Prevent pagination in GDB_INTERNALFLAGS
2020-10-26 9:01 [PATCH][gdb/testsuite] Prevent pagination in GDB_INTERNALFLAGS Tom de Vries
@ 2020-10-26 14:54 ` Simon Marchi via Gdb-patches
0 siblings, 0 replies; 2+ messages in thread
From: Simon Marchi via Gdb-patches @ 2020-10-26 14:54 UTC (permalink / raw)
To: Tom de Vries, gdb-patches
On 2020-10-26 5:01 a.m., Tom de Vries wrote:
> Hi,
>
> When running test-case gdb.base/corefile.exp with target board readnow, we run
> into:
> ...
> Reading symbols from outputs/gdb.base/corefile/corefile...^M
> Expanding full symbols from outputs/gdb.base/corefile/corefile...^M
> [New LWP 2293]^M
> Core was generated by `outputs/gdb.base/corefile/co'.^M
> Program terminated with signal SIGABRT, Aborted.^M
> --Type <RET> for more, q to quit, c to continue without paging--\
> FAIL: gdb.base/corefile.exp: (timeout) starting with -core
> ...
>
> In commit bd447abb24 "Make gdb.base/corefile.exp work on terminals with few
> rows", pagination (in the same test-case) is prevented using:
> ...
> set stty_init "rows 25 cols 80"
> ...
> but this doesn't work in our case because using -readnow adds an extra line
> "Expanding full symbols".
>
> The test passes when increasing rows to 26. However, increasing the rows by
> some n only fixes the problem for n lines, and things will break again if
> somehow we end up with n + 1 lines.
>
> Instead, fix this by setting heigth and width in INTERNAL_GDBFLAGS. This
> solution was not chosen in commit bd447abb24 because it doesn't handle
> pagination due to the introduction text. But it does handle the pagination
> due to the extra "Expanding full symbols", and any other line printed during
> and after file loading.
>
> Tested on x86_64-linux, with and without readnow.
>
> With -readnow, fixes these FAILs:
> ...
> FAIL: gdb.base/corefile.exp: (timeout) starting with -core
> FAIL: gdb.base/reread-readsym.exp: source reread-readsym.gdb 1 (timeout)
> ...
>
> Any comments?
>
> Thanks,
> - Tom
I don't see the failures on Ubuntu 20.04. The set of lines printed when
loading the core are probably a bit different depending on the distro,
which libraries are loaded, etc. But I think I can reproduce it if I
reduce the rows to 20 in stty_init.
The patch LGTM.
Simon
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-10-26 14:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 9:01 [PATCH][gdb/testsuite] Prevent pagination in GDB_INTERNALFLAGS Tom de Vries
2020-10-26 14:54 ` Simon Marchi via Gdb-patches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox