From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75667 invoked by alias); 15 Jul 2015 16:14:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 75627 invoked by uid 89); 15 Jul 2015 16:14:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f46.google.com Received: from mail-pa0-f46.google.com (HELO mail-pa0-f46.google.com) (209.85.220.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 15 Jul 2015 16:14:14 +0000 Received: by padck2 with SMTP id ck2so26413509pad.0 for ; Wed, 15 Jul 2015 09:14:13 -0700 (PDT) X-Received: by 10.70.90.133 with SMTP id bw5mr9639968pdb.85.1436976853033; Wed, 15 Jul 2015 09:14:13 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id g2sm5172119pdh.11.2015.07.15.09.14.09 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 15 Jul 2015 09:14:11 -0700 (PDT) From: Yao Qi To: Jan Kratochvil Cc: Yao Qi , Pedro Alves , 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 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> <20150217165629.GA24936@host1.jankratochvil.net> <55A4CDD1.6060907@gmail.com> <20150714180748.GA13461@host1.jankratochvil.net> Date: Wed, 15 Jul 2015 16:14:00 -0000 In-Reply-To: <20150714180748.GA13461@host1.jankratochvil.net> (Jan Kratochvil's message of "Tue, 14 Jul 2015 20:07:48 +0200") Message-ID: <86fv4pjt4m.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00438.txt.bz2 Jan Kratochvil writes: > (1) The testcase did not really test if elf64-i386 is supported by GDB (B= FD). > That was OK for a Fedora testcase but I forgot about it when submitting it > upstream. > > I haven't really verified if the GNU target is elf64-little but it seems = so, > no other one seems suitable from: > elf32-x86-64 > elf64-big > elf64-k1om > elf64-l1om > elf64-little > elf64-x86-64 > pei-x86-64 Hi Jan, Why can't we use istarget here? I thought we still check istarget "x86_64-*-*", no? > > (2) The output of the "core-file" command itself can be arbitrary as the > elf64-i386 file with x86_64 registers is really broken; but that does not > matter much, important is the following test whether core file memory is > readable. "that does not matter much" mean if internal error isn't triggered, any output is acceptable, right? and the purpose of following test "x/i $addre= ss" is to verify this (internal error not triggered)? Bug 17808 describes that GDB gets internal error when it loads in i386-biarch-core.core. > ./configure --enable-64-bit-bfd > (gdb) core-file /home/jkratoch/redhat/gdb-test-build32-plus64/gdb/testsu= ite/gdb.arch/i386-biarch-core.core^M > warning: Couldn't find general-purpose registers in core file.^M > Failed to read a valid object file image from memory.^M > warning: Couldn't find general-purpose registers in core file.^M > #0 in ?? ()^M > (gdb) FAIL: gdb.arch/i386-biarch-core.exp: core-file > x/i 0x400078^M > 0x400078: hlt ^M > (gdb) PASS: gdb.arch/i386-biarch-core.exp: .text is readable > > # 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 par= se it. > # This is just a problem of the test case, real-world elf64-i386 file wi= ll have > # 32bit PRSTATUS. One cannot prepare elf64-i386 core file from elf32-i3= 86 by > # objcopy as it corrupts the core file beyond all recognition. As you said, the output of command "core-file" doesn't matter much, we need to update the comments here. > -gdb_test "core-file ${corefile}" "\r\nwarning: Unexpected size of sectio= n `\\.reg/6901' in core file\\.\r\n.*Core was generated by `\[^\r\n\]*'\\.\= r\nProgram terminated with signal SIGSEGV, Segmentation fault\\.\r\n.*" "co= re-file" > +gdb_test "core-file ${corefile}" ".*" "core-file" >=20=20 > gdb_test "x/i $address" "\r\n\[ \t\]*$address:\[ \t\]*hlt\[ \t\]*" ".tex= t is readable" We also need comment here to explain the purpose this "x/i $address" test. --=20 Yao (=E9=BD=90=E5=B0=A7)