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

Message ID 20180917221700.14302-1-sergiodj@redhat.com
State New, archived
Headers

Commit Message

Sergio Durigan Junior Sept. 17, 2018, 10:17 p.m. UTC
  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-17  Sergio Durigan Junior  <sergiodj@redhat.com>

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

Comments

Tom Tromey Sept. 18, 2018, 4:30 a.m. UTC | #1
>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:

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

Sergio> OK?

Yes, thank you.

Tom
  
Sergio Durigan Junior Sept. 18, 2018, 5:54 p.m. UTC | #2
On Tuesday, September 18 2018, Tom Tromey wrote:

>>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
> Sergio> The fix is, again, to extend the current regexp and expect for the
> Sergio> optional "arch=" part.  With this patch, the test now passes on both
> Sergio> scenarios.
>
> Sergio> OK?
>
> Yes, thank you.

Thanks, Tom.  Pushed:

5031d0ae0b9fb1a42eb8ff9d2b5098a56774cee1
  

Patch

diff --git a/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp b/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp
index 64bcfe0099..d3a4eab947 100644
--- a/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp
+++ b/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.exp
@@ -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"