Expect optional "arch=" when executing "-stack-list-frames" on gdb.arch/amd64-invalid...
authorSergio Durigan Junior <sergiodj@redhat.com>
Tue, 18 Sep 2018 17:53:06 +0000 (13:53 -0400)
committerSergio Durigan Junior <sergiodj@redhat.com>
Tue, 18 Sep 2018 17:53:28 +0000 (13:53 -0400)
commitb4c0d1a440d054cd198041ddf0ba43b83794186f
tree273fb5cdb5bf5f4414fd8b0c9e8224648d6ea3e4
parent7a6d2b458f95030f433a0dcdabd5cda7ee695a9b
Expect optional "arch=" when executing "-stack-list-frames" on gdb.arch/amd64-invalid-stack-middle.exp

While regression-testing GDB on Fedora Rawhide, I saw the following
output when running gdb.arch/amd64-invalid-stack-middle.exp's
"-stack-list-frames" test:

  (gdb) interpreter-exec mi "-stack-list-frames"
  ^done,stack=[frame={level="0",addr="0x000000000040115a",func="breakpt",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/fedora/gdb/master/gdb-8.2.50.20180917/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="27",arch="i386:x86-64"},frame={level="1",addr="0x000000000040116a",func="func5",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/fedora/gdb/master/gdb-8.2.50.20180917/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="32",arch="i386:x86-64"},frame={level="2",addr="0x000000000040117a",func="func4",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/fedora/gdb/master/gdb-8.2.50.20180917/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="38",arch="i386:x86-64"},frame={level="3",addr="0x000000000040118a",func="func3",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/fedora/gdb/master/gdb-8.2.50.20180917/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="44",arch="i386:x86-64"}]

This test is currently failing on Rawhide.  However, this output is
almost the same as I get on my local Fedora 28 machine (where the test
is passing):

  (gdb) interpreter-exec mi "-stack-list-frames"
  ^done,stack=[frame={level="0",addr="0x00000000004005da",func="breakpt",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/work/src/git/binutils-gdb/binutils-gdb/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="27"},frame={level="1",addr="0x00000000004005ea",func="func5",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/work/src/git/binutils-gdb/binutils-gdb/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="32"},frame={level="2",addr="0x00000000004005fa",func="func4",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/work/src/git/binutils-gdb/binutils-gdb/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="38"},frame={level="3",addr="0x000000000040060a",func="func3",file="amd64-invalid-stack-middle.c",fullname="/home/sergio/work/src/git/binutils-gdb/binutils-gdb/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c",line="44"}]

With the exception that there's an "arch=" keyword on Fedora Rawhide's
version.  This is because, on Rawhide, I've compiled GDB with
"--enable-targets=xyz,kqp,etc.", while locally I haven't.

This is easy to fix: we just have to extend the regexp and expect for
the optional "arch=" keyword there.  It's what this patch does.  With
it applied, the test now passes everywhere.

OK?

gdb/testsuite/ChangeLog:
2018-09-18  Sergio Durigan Junior  <sergiodj@redhat.com>

* gdb.arch/amd64-invalid-stack-middle.exp: Expect optional
"arch=" keyword when executing "-stack-list-frames".
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp