[gdb/testsuite] Fix gdb.dwarf2/frame-inlined-in-outer-frame.exp
authorTom de Vries <tdevries@suse.de>
Tue, 8 Sep 2020 09:51:29 +0000 (11:51 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 8 Sep 2020 09:51:29 +0000 (11:51 +0200)
I'm running into the following FAIL:
...
(gdb) starti ^M
Starting program: frame-inlined-in-outer-frame frame^M
^M
^M
Program stopped.^M
0x0000000000401000 in _start ()^M
(gdb) PASS: gdb.dwarf2/frame-inlined-in-outer-frame.exp: frame
frame^M
(gdb) FAIL: gdb.dwarf2/frame-inlined-in-outer-frame.exp: step into foo
stepi^M
0x0000000000401001 in foo ()^M
...

The problem is that the .exp file issues a gdb_starti_cmd without consuming
the resulting prompt.  Consequently, the gdb_test issuing the frame command
consumes that prompt, and things are out-of-sync from that point onwards.

Fix this by consuming the gdb prompt after gdb_starti_cmd.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-09-08  Tom de Vries  <tdevries@suse.de>

* gdb.dwarf2/frame-inlined-in-outer-frame.exp: Consume gdb prompt
after gdb_starti_cmd.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp

index 854dca5128e049a3f0b7137519a8a55e78f8f7c9..33987e469a63daa0a1616db998d34851593bd35c 100644 (file)
@@ -1,3 +1,8 @@
+2020-09-08  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.dwarf2/frame-inlined-in-outer-frame.exp: Consume gdb prompt
+       after gdb_starti_cmd.
+
 2020-09-03  Alok Kumar Sharma  <AlokKumar.Sharma@amd.com>
 
        * lib/fortran.exp (fortran_complex8): New proc.
index 721b521e830669e3c19a5ce62265fcc218241615..0ded2c0e766924198244effc813cfa2c68a78214 100644 (file)
@@ -105,6 +105,7 @@ if { [gdb_starti_cmd] != 0 } {
     fail "failed to run to first instruction"
     return
 }
+gdb_test "" "Program stopped.*" "starti prompt"
 
 gdb_test "frame" "in _start .*"