Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Cc: Scott.Linder@amd.com, Zoran.Zaric@amd.com
Subject: [committed][gdb/testsuite] Fix gdb.dwarf2/frame-inlined-in-outer-frame.exp
Date: Tue, 8 Sep 2020 11:55:22 +0200	[thread overview]
Message-ID: <5c2950c4-06a5-5ff8-6bf9-a329469d49e6@suse.de> (raw)
In-Reply-To: <20200827205724.409603-4-simon.marchi@polymtl.ca>

[-- Attachment #1: Type: text/plain, Size: 397 bytes --]

[ was: Re: [PATCH v2 3/3] gdb: support frames inlined into the outer frame ]

On 8/27/20 10:57 PM, Simon Marchi via Gdb-patches wrote:
> +clean_restart $binfile
> +
> +if { [gdb_starti_cmd] != 0 } {
> +    fail "failed to run to first instruction"
> +    return
> +}
> +
> +gdb_test "frame" "in _start .*"
> +
> +gdb_test "stepi" "in foo .*" "step into foo"

Patch below committed.

Thanks,
- Tom

[-- Attachment #2: 0001-gdb-testsuite-Fix-gdb.dwarf2-frame-inlined-in-outer-frame.exp.patch --]
[-- Type: text/x-patch, Size: 1493 bytes --]

[gdb/testsuite] Fix gdb.dwarf2/frame-inlined-in-outer-frame.exp

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/gdb.dwarf2/frame-inlined-in-outer-frame.exp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
index 721b521e83..0ded2c0e76 100644
--- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
+++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
@@ -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 .*"
 

  reply	other threads:[~2020-09-08  9:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 20:57 [PATCH v2 0/3] Support frames inlined in outer frames Simon Marchi
2020-08-27 20:57 ` [PATCH v2 1/3] gdb: make frame_unwind_got_optimized return a not_lval value Simon Marchi
2020-08-27 21:37   ` Pedro Alves
2020-08-27 20:57 ` [PATCH v2 2/3] gdb: introduce explicit outer frame id kind Simon Marchi
2020-08-27 21:38   ` Pedro Alves
2020-08-27 20:57 ` [PATCH v2 3/3] gdb: support frames inlined into the outer frame Simon Marchi
2020-09-08  9:55   ` Tom de Vries [this message]
2020-08-27 21:44 ` [PATCH v2 0/3] Support frames inlined in outer frames Pedro Alves
2020-08-28  8:50 ` Andrew Burgess
2020-08-31 17:32   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c2950c4-06a5-5ff8-6bf9-a329469d49e6@suse.de \
    --to=tdevries@suse.de \
    --cc=Scott.Linder@amd.com \
    --cc=Zoran.Zaric@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox