File gdb-testsuite-avoid-pagination-in-attach-32.exp.patch of Package gdb.15106

Avoid pagination in attach-32.exp

When running test-case attach-32.exp from
gdb-6.3-inferior-notification-20050721.patch, we run into:
...
spawn build/gdb/testsuite/../../gdb/gdb -nw -nx \
  -data-directory build/gdb/testsuite/../data-directory --pid=27520
GNU gdb (GDB) 8.3.50.20190726-git
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 27520
Reading symbols from build/gdb/testsuite/outputs/gdb.base/attach-32/attach-32...
Reading symbols from /lib/libm.so.6...
(No debugging symbols found in /lib/libm.so.6)
Reading symbols from /lib/libc.so.6...
(No debugging symbols found in /lib/libc.so.6)
(No debugging symbols found in /lib/libc.so.6)
Reading symbols from /lib/ld-linux.so.2...
(No debugging symbols found in /lib/ld-linux.so.2)
main () at /data/gdb_versions/devel/src/gdb/testsuite/gdb.base/attach-32.c:15
--Type <RET> for more, q to quit, c to continue without paging--ERROR: \
  (timeout) GDB never initialized after 10 seconds.
...
The test-case hangs because pagination is activated, with height == 25
due to gdb_init.

Fix this by starting gdb using -iex "set width 0" -iex "set height 0" -quiet,
similar to how it is done in attach.exp (see commit fef1b2933d "Avoid
pagination in attach.exp").

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2019-07-26  Tom de Vries  <tdevries@suse.de>

	* gdb.base/attach-32.exp: Start gdb using -iex "set width 0" -iex
	"set height 0" -quiet.

---
 gdb/testsuite/gdb.base/attach-32.exp | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/gdb/testsuite/gdb.base/attach-32.exp b/gdb/testsuite/gdb.base/attach-32.exp
index 67ded02ccf..7627a0a5db 100644
--- a/gdb/testsuite/gdb.base/attach-32.exp
+++ b/gdb/testsuite/gdb.base/attach-32.exp
@@ -212,10 +212,14 @@ if { [istarget "*-*-cygwin*"] } {
     set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
 }
 
-set GDBFLAGS_orig $GDBFLAGS
-set GDBFLAGS "--pid=$testpid"
-gdb_start
-set GDBFLAGS $GDBFLAGS_orig
+set res [gdb_spawn_with_cmdline_opts \
+	     "-quiet -iex \"set height 0\" -iex \"set width 0\" --pid=$testpid"]
+set test "starting with --pid"
+gdb_test_multiple "" $test {
+    -re "Reading symbols from.*$gdb_prompt $" {
+	pass "$test"
+    }
+}
 
 gdb_reinitialize_dir $srcdir/$subdir
 
@@ -234,10 +238,14 @@ if { [istarget "*-*-cygwin*"] } {
     set testpid [ exec ps -e | gawk "{ if (\$1 == $testpid) print \$4; }" ]
 }
 
-set GDBFLAGS_orig $GDBFLAGS
-set GDBFLAGS "--pid=$testpid"
-gdb_start
-set GDBFLAGS $GDBFLAGS_orig
+set res [gdb_spawn_with_cmdline_opts \
+	     "-quiet -iex \"set height 0\" -iex \"set width 0\" --pid=$testpid"]
+set test "starting with --pid"
+gdb_test_multiple "" $test {
+    -re "Reading symbols from.*$gdb_prompt $" {
+	pass "$test"
+    }
+}
 
 gdb_reinitialize_dir $srcdir/$subdir
 do_call_attach_tests
openSUSE Build Service is sponsored by