From patchwork Fri Oct 2 20:25:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 8918 Received: (qmail 62949 invoked by alias); 2 Oct 2015 20:26:58 -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 62934 invoked by uid 89); 2 Oct 2015 20:26:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 02 Oct 2015 20:26:57 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1Zi6us-0004c3-8t from Sandra_Loosemore@mentor.com for gdb-patches@sourceware.org; Fri, 02 Oct 2015 13:26:54 -0700 Received: from [IPv6:::1] (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.224.2; Fri, 2 Oct 2015 13:26:53 -0700 Message-ID: <560EE854.2040705@codesourcery.com> Date: Fri, 2 Oct 2015 14:25:56 -0600 From: Sandra Loosemore User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: gdb-patches Subject: [testsuite, committed] fix gdb.dwarf2/staticvirtual.exp regexp I saw that gdb.dwarf2/staticvirtual.exp was failing on some bare-metal targets. This test manufactures some DWARF for a function at address 0x1000, and the regexp was only matching if that address wasn't mapped on the target. Our hardware nios2-elf test boards don't have memory mapped there, but the simulator we use for testing does. I also saw similar failures on arm-none-eabi. On Nios II and ARM GNU/Linux targets this address is unmapped so the test is passing. Since it appears that the point of this test is to ensure that GDB doesn't crash, I don't think there's any actual requirement for the address to be unmapped, and no reason not to generalize the test to count any reasonable output as a PASS. So, I've checked in the attached patch under the obvious fix rule. -Sandra diff --git a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp index 06d46e1..dd85b7e 100644 --- a/gdb/testsuite/gdb.dwarf2/staticvirtual.exp +++ b/gdb/testsuite/gdb.dwarf2/staticvirtual.exp @@ -51,4 +51,9 @@ if { [prepare_for_testing ${testfile}.exp ${testfile} \ } # gdb/18021: The test below would cause GDB to crash. -gdb_test "p S::~S" "0x1000" +# Depending on whether the target maps memory at address 0x1000, +# on success this may either print something like +# $1 = {void (void)} 0x1000 <.*> +# or +# Cannot access memory at address 0x1000 +gdb_test "p S::~S" "0x1000.*"