From patchwork Tue Jan 31 13:55:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Machado X-Patchwork-Id: 19063 Received: (qmail 95256 invoked by alias); 31 Jan 2017 13:55:42 -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 95182 invoked by uid 89); 31 Jan 2017 13:55:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=gdb_prompt, objcopy 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; Tue, 31 Jan 2017 13:55:33 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1cYYuC-0002M8-56 from Luis_Gustavo@mentor.com for gdb-patches@sourceware.org; Tue, 31 Jan 2017 05:55:32 -0800 Received: from Opsys.world.mentorg.com (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; Tue, 31 Jan 2017 05:55:31 -0800 From: Luis Machado To: Subject: [PATCH] Make gdb.arch/i386-biarch-core.exp more robust Date: Tue, 31 Jan 2017 07:55:27 -0600 Message-ID: <1485870927-12623-1-git-send-email-lgustavo@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes This test attempts to load a x86 core file no matter what the target architecture is. If the architecture is not x86, GDB will not recognize the core file and therefore won't have any memory to inspect. All we will have is a memory read error, resulting in a FAIL. The following patch addresses this by checking if we successfully loaded the core file. If not, just return. Otherwise it keeps testing. gdb/testsuite/ChangeLog: 2017-01-31 Luis Machado * gdb.arch/i386-biarch-core.exp: Return if core file was not recognized. --- gdb/testsuite/gdb.arch/i386-biarch-core.exp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.arch/i386-biarch-core.exp b/gdb/testsuite/gdb.arch/i386-biarch-core.exp index 4c5f450..2776ac3 100644 --- a/gdb/testsuite/gdb.arch/i386-biarch-core.exp +++ b/gdb/testsuite/gdb.arch/i386-biarch-core.exp @@ -62,7 +62,16 @@ if {$corestat(size) != 102400} { # objcopy as it corrupts the core file beyond all recognition. # The output therefore does not matter much, just we should not get GDB # internal error. -gdb_test "core-file ${corefile}" ".*" "core-file" +set test "load core file" +gdb_test_multiple "core-file ${corefile}" $test { + -re ".* no core file handler recognizes format(.*\r\n)?$gdb_prompt $" { + untested $test + return + } + -re "\r\n$gdb_prompt $" { + pass $test + } +} # Test if at least the core file segments memory has been loaded. # https://bugzilla.redhat.com/show_bug.cgi?id=457187