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:43 +0000 (13:53 -0400)
committerSergio Durigan Junior <sergiodj@redhat.com>
Tue, 18 Sep 2018 17:54:02 +0000 (13:54 -0400)
Another case of incomplete regexp.  The problem is very similar to the
one happening with gdb.arch/amd64-invalid-stack-middle.exp.

The output when GDB is compiled with "--enable-targets" is:

  (gdb) interpreter-exec mi "-stack-list-frames"
  ^done,stack=[frame={level="0",addr="0x00000000004005e7",func="func2",arch="i386:x86-64"}]

While the output when "--enable-targets" is not specified is:

  (gdb) interpreter-exec mi "-stack-list-frames"
  ^done,stack=[frame={level="0",addr="0x00000000004005e7",func="func2"}]

The fix is, again, to extend the current regexp and expect for the
optional "arch=" part.  With this patch, the test now passes on both
scenarios.

OK?

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

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

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp

index 8c0438f355cc990df4cc463fb98045daa315390a..701d979b79a62f8adcaa14fb6813f434206e6219 100644 (file)
@@ -1,3 +1,8 @@
+2018-09-18  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+       * gdb.arch/amd64-invalid-stack-top.exp: Expect optional
+       "arch=" keyword when executing "-stack-list-frames".
+
 2018-09-18  Sergio Durigan Junior  <sergiodj@redhat.com>
 
        * gdb.arch/amd64-invalid-stack-middle.exp: Expect optional
index 64bcfe0099416d5c7204f8f7d97def4075de033f..d3a4eab9475c7832b11979ce1609027b0a902374 100644 (file)
@@ -72,9 +72,9 @@ if ![runto breakpt] {
 }
 
 gdb_test "interpreter-exec mi \"-stack-list-frames\"" \
-    "\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"func2\"\}\\\]" \
+    "\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"func2\"(,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=\"func2\"\}\\\]" \
+    "\\^done,stack=\\\[frame=\{level=\"0\",addr=\"$hex\",func=\"func2\"(,arch=\"\[^\"\]+\")?\}\\\]" \
     "check mi -stack-list-frames command, second time"