public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Expect optional "arch=" when executing "-stack-list-frames" on gdb.arch/amd64-invalid-stack-middle.exp
@ 2018-09-17 22:08 Sergio Durigan Junior
  2018-09-18  4:29 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Sergio Durigan Junior @ 2018-09-17 22:08 UTC (permalink / raw)
  To: GDB Patches; +Cc: Sergio Durigan Junior

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-17  Sergio Durigan Junior  <sergiodj@redhat.com>

	* gdb.arch/amd64-invalid-stack-middle.exp: Expect optional
	"arch=" keyword when executing "-stack-list-frames".
---
 gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp b/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp
index c00bfa10bd..2bb0344052 100644
--- a/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp
+++ b/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.exp
@@ -70,9 +70,9 @@ if ![runto breakpt] {
 }
 
 gdb_test "interpreter-exec mi \"-stack-list-frames\"" \
-    "\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"breakpt\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"func5\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"func4\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"\},frame=\{level=\"3\",addr=\"$hex\",func=\"func3\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"\}\\\]" \
+    "\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"breakpt\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"(,arch=\"\[^\"\]+\")?\},frame=\{level=\"1\",addr=\"$hex\",func=\"func5\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"(,arch=\"\[^\"\]+\")?\},frame=\{level=\"2\",addr=\"$hex\",func=\"func4\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"(,arch=\"\[^\"\]+\")?\},frame=\{level=\"3\",addr=\"$hex\",func=\"func3\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"(,arch=\"\[^\"\]+\")?\}\\\]" \
     "check mi -stack-list-frames command, first time"
 
 gdb_test "interpreter-exec mi \"-stack-list-frames\"" \
-    "\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"breakpt\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"\},frame=\{level=\"1\",addr=\"$hex\",func=\"func5\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"\},frame=\{level=\"2\",addr=\"$hex\",func=\"func4\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"\},frame=\{level=\"3\",addr=\"$hex\",func=\"func3\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"\}\\\]" \
+    "\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"breakpt\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"(,arch=\"\[^\"\]+\")?\},frame=\{level=\"1\",addr=\"$hex\",func=\"func5\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"(,arch=\"\[^\"\]+\")?\},frame=\{level=\"2\",addr=\"$hex\",func=\"func4\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"(,arch=\"\[^\"\]+\")?\},frame=\{level=\"3\",addr=\"$hex\",func=\"func3\",file=\"\[^\"\]+\",fullname=\"\[^\"\]+\",line=\"${decimal}\"(,arch=\"\[^\"\]+\")?\}\\\]" \
     "check mi -stack-list-frames command, second time"
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Expect optional "arch=" when executing "-stack-list-frames" on gdb.arch/amd64-invalid-stack-middle.exp
  2018-09-17 22:08 [PATCH] Expect optional "arch=" when executing "-stack-list-frames" on gdb.arch/amd64-invalid-stack-middle.exp Sergio Durigan Junior
@ 2018-09-18  4:29 ` Tom Tromey
  2018-09-18 17:54   ` Sergio Durigan Junior
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2018-09-18  4:29 UTC (permalink / raw)
  To: Sergio Durigan Junior; +Cc: GDB Patches

>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:

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

Sergio> OK?

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

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

Thanks, this is ok.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Expect optional "arch=" when executing "-stack-list-frames" on gdb.arch/amd64-invalid-stack-middle.exp
  2018-09-18  4:29 ` Tom Tromey
@ 2018-09-18 17:54   ` Sergio Durigan Junior
  0 siblings, 0 replies; 3+ messages in thread
From: Sergio Durigan Junior @ 2018-09-18 17:54 UTC (permalink / raw)
  To: Tom Tromey; +Cc: GDB Patches

On Tuesday, September 18 2018, Tom Tromey wrote:

>>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
> Sergio> This is easy to fix: we just have to extend the regexp and expect for
> Sergio> the optional "arch=" keyword there.  It's what this patch does.  With
> Sergio> it applied, the test now passes everywhere.
>
> Sergio> OK?
>
> Sergio> gdb/testsuite/ChangeLog:
> Sergio> 2018-09-17  Sergio Durigan Junior  <sergiodj@redhat.com>
>
> Sergio> 	* gdb.arch/amd64-invalid-stack-middle.exp: Expect optional
> Sergio> 	"arch=" keyword when executing "-stack-list-frames".
>
> Thanks, this is ok.

Thanks, Tom.  Pushed:

b4c0d1a440d054cd198041ddf0ba43b83794186f

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-18 17:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-17 22:08 [PATCH] Expect optional "arch=" when executing "-stack-list-frames" on gdb.arch/amd64-invalid-stack-middle.exp Sergio Durigan Junior
2018-09-18  4:29 ` Tom Tromey
2018-09-18 17:54   ` Sergio Durigan Junior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).