aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-06-02 14:20:25 +0200
committerTom de Vries <tdevries@suse.de>2020-06-02 14:20:25 +0200
commit621eacdfb42f9deba559ea0bada70f6ca2367f5f (patch)
treeb8f992f1f4d90e9259291ca15d03b946ed2bcc8b /gdb
parent0bee4d1c08523419016db14c3706f922ffc6f753 (diff)
downloadgdb-621eacdfb42f9deba559ea0bada70f6ca2367f5f.zip
gdb-621eacdfb42f9deba559ea0bada70f6ca2367f5f.tar.gz
gdb-621eacdfb42f9deba559ea0bada70f6ca2367f5f.tar.bz2
[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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.dwarf2/multidictionary.exp9
2 files changed, 8 insertions, 6 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ec6b24a..ec6878f 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-06-02 Tom de Vries <tdevries@suse.de>
+
+ * gdb.dwarf2/multidictionary.exp: Don't use
+ gdb_spawn_with_cmdline_opts.
+
2020-06-01 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.cp/step-and-next-inline.exp (do_test): Skip all tests in the
diff --git a/gdb/testsuite/gdb.dwarf2/multidictionary.exp b/gdb/testsuite/gdb.dwarf2/multidictionary.exp
index 01e5a0d..45ba1ed 100644
--- a/gdb/testsuite/gdb.dwarf2/multidictionary.exp
+++ b/gdb/testsuite/gdb.dwarf2/multidictionary.exp
@@ -147,12 +147,9 @@ if {[build_executable $testfile.exp $testfile [list $asm_file $srcfile] {}] \
}
# We force the DIEs above to be read in via "-readnow".
-gdb_spawn_with_cmdline_opts "-readnow"
-set test "initial prompt"
-gdb_test_multiple "" $test {
- -re ".*$gdb_prompt $" {
- pass "$test"
- }
+save_vars { GDBFLAGS } {
+ set GDBFLAGS "$GDBFLAGS -readnow"
+ clean_restart
}
gdb_load $binfile