[gdb/testsuite] Fix scrolling in gdb.dwarf2/multidictionary.exp
Consider a gdb_load patch to call the gdb_file_cmd twice:
...
proc gdb_load { arg } {
if { $arg != "" } {
+ set res [gdb_file_cmd $arg]
+ if { $res != 0 } {
+ return $res
+ }
return [gdb_file_cmd $arg]
}
return 0
}
...
With this patch, I run into:
...
(gdb) kill^M
The program is not being run.^M
(gdb) ^M</outputs/gdb.dwarf2/multidictionary/multidictionary^M
<.dwarf2/multidictionary/multidictionary"? (y or n)
ERROR: Couldn't load outputs/gdb.dwarf2/multidictionary/multidictionary \
into gdb (timeout).
p 1^M
Please answer y or n.^M
<.dwarf2/multidictionary/multidictionary"? (y or n) n^M
Not confirmed.^M
(gdb) UNRESOLVED: gdb.dwarf2/multidictionary.exp: GDB is alive \
(got interactive prompt)
...
The problem is that the second file command results in a prompt, which is
normally handled by gdb_file_cmd, but not recognized because the initial part
of the prompt is scrolled out.
This in turn is caused by using gdb_spawn_with_cmdline_opts without a
subsequent "set width 0".
Fix this by avoiding gdb_spawn_with_cmdline_opts, and forcing -readline by
temporarily modifying GDBFLAGS instead.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-06-02 Tom de Vries <tdevries@suse.de>
* gdb.dwarf2/multidictionary.exp: Don't use
gdb_spawn_with_cmdline_opts.