From patchwork Mon Sep 17 22:17:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Durigan Junior X-Patchwork-Id: 29430 Received: (qmail 52246 invoked by alias); 17 Sep 2018 22:17:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 52234 invoked by uid 89); 17 Sep 2018 22:17:05 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 17 Sep 2018 22:17:04 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF7605F75D for ; Mon, 17 Sep 2018 22:17:03 +0000 (UTC) Received: from psique.yyz.redhat.com (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 972B518102; Mon, 17 Sep 2018 22:17:01 +0000 (UTC) From: Sergio Durigan Junior To: GDB Patches Cc: Sergio Durigan Junior Subject: [PATCH] Expect optional "arch=" when executing "-stack-list-frames" on gdb.arch/amd64-invalid-stack-top.exp Date: Mon, 17 Sep 2018 18:17:00 -0400 Message-Id: <20180917221700.14302-1-sergiodj@redhat.com> X-IsSubscribed: yes 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 * 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(-) 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"