From patchwork Tue Feb 17 16:56:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 5135 Received: (qmail 28695 invoked by alias); 17 Feb 2015 16:56:40 -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 28679 invoked by uid 89); 17 Feb 2015 16:56:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 17 Feb 2015 16:56:37 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1HGuYKZ027330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 17 Feb 2015 11:56:34 -0500 Received: from host1.jankratochvil.net ([10.40.204.17]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1HGuTb4002490 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Tue, 17 Feb 2015 11:56:32 -0500 Date: Tue, 17 Feb 2015 17:56:29 +0100 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Andreas Arnez Subject: Re: ping: [testsuite patch] for: [PATCH] [PR corefiles/17808] i386: Fix internal error when prstatus in core file is too big Message-ID: <20150217165629.GA24936@host1.jankratochvil.net> References: <874ms18cyz.fsf@br87z6lw.de.ibm.com> <20150108164327.GA29029@host2.jankratochvil.net> <20150205073758.GA25305@host1.jankratochvil.net> <54D33C45.4010706@redhat.com> <20150214151231.GA29106@host1.jankratochvil.net> <54E33A8D.80504@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <54E33A8D.80504@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes On Tue, 17 Feb 2015 13:56:45 +0100, Pedro Alves wrote: > I'd rather just not uuencode the binary, dropping the dependency > on uudecode. > > I think this is the first time we're adding a binary core dump > to the testsuite. I think elfutils (a GPLv3 project) > just puts test core binaries directly in git, right? Yes, it does. It has the same problem of reviews by mail. But while reading through GIT for this patch I have found there is 'git apply' so the binary patches are manageable. (I was using only 'git am' before.) Considering the patch approved now, posting just as a preview of a binary patch - from 'git diff --binary HEAD'. Jan gdb/testsuite/ChangeLog 2015-02-14 Jan Kratochvil PR corefiles/17808 * gdb.arch/i386-biarch-core.core.bz2: New file. * gdb.arch/i386-biarch-core.exp: New file. diff --git a/gdb/testsuite/gdb.arch/i386-biarch-core.core.bz2 b/gdb/testsuite/gdb.arch/i386-biarch-core.core.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..8b823f791d4dc4fa87c0b56138e8deaf8a898dda GIT binary patch literal 420 zcmV;V0bBk;T4*^jL0KkKSr9Ns%m4(J|NsC0@sZ#Oj7eJr*g$q*9ALmgNB{sJ02F`# zfB?V<7YMKcW(bCao`h3rsf{Mlq#IKqk)RDUGHpOc!QRZcn&KXoBCv}+xm_dY!FKfb z. + +# Test ability to load an elf64-i386 core file. The provided core file was +# elf64-x8664 one but it got binary patched to i386: +# Elf32_Ehdr.e_machine @0x12..0x13 +# Elf64_Ehdr.e_machine @0x12..0x13 +# #define EM_386 3 /* Intel 80386 */ +# #define EM_X86_64 62 /* AMD x86-64 architecture */ +# patch @0x12: 0x3E -> 0x03 + +standard_testfile + +if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then { + verbose "Skipping i386-biarch-core test." + return +} + +set corebz2file ${srcdir}/${subdir}/${testfile}.core.bz2 +set corefile ${objdir}/${subdir}/${testfile}.core +# Entry point of the original executable. +set address 0x400078 + +if {[catch "system \"bzip2 -dc ${corebz2file} >${corefile}\""] != 0} { + untested "failed bzip2" + return -1 +} +file stat ${corefile} corestat +if {$corestat(size) != 102400} { + untested "bzip2 produces invalid result" + return -1 +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir + +# Wrongly built GDB complains by: +# "..." is not a core dump: File format not recognized +# As the provided test core has 64bit PRSTATUS i386 built GDB cannot parse it. +# This is just a problem of the test care, real-world elf64-i386 file will have +# 32bit PRSTATUS. One cannot prepare elf64-i386 core file from elf32-i386 by +# objcopy as it corrupts the core file beyond all recognition. +gdb_test "core-file ${corefile}" "\r\nwarning: Unexpected size of section `\\.reg/6901' in core file\\.\r\n.*Core was generated by `\[^\r\n\]*'\\.\r\nProgram terminated with signal SIGSEGV, Segmentation fault\\.\r\n.*" "core-file" + +gdb_test "x/i $address" "\r\n\[ \t\]*$address:\[ \t\]*hlt\[ \t\]*" ".text is readable"