From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org, Andreas Arnez <arnez@linux.vnet.ibm.com>
Subject: Re: ping: [testsuite patch] for: [PATCH] [PR corefiles/17808] i386: Fix internal error when prstatus in core file is too big
Date: Tue, 17 Feb 2015 16:56:00 -0000 [thread overview]
Message-ID: <20150217165629.GA24936@host1.jankratochvil.net> (raw)
In-Reply-To: <54E33A8D.80504@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 651 bytes --]
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
[-- Attachment #2: 1 --]
[-- Type: text/plain, Size: 3680 bytes --]
gdb/testsuite/ChangeLog
2015-02-14 Jan Kratochvil <jan.kratochvil@redhat.com>
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)RDUGHpO<v_p)UG}8%@kT4??MhL<U8ejlH
zB1KJ#H1!Pt8X5oq0qB4LH2LOqD1!(HVsn%SfMx>c!QRZcn&KXoBCv}+xm_dY!FKfb
z<cR35D_)1z4|KV6eb%LX{8Ta1M+!lOgBIE}UyZ6}K#PnJk}AfSksdIR5Dhli3gbj*
zS1Gx;Vn_uH5DlOyX|$UWTSoAvLP7yrt`0lUf^8+6mjXdHgddhnkxXs|EYJcM^0B*K
zcJ*i|mK+)9Ek&WS{-!x8jRps!C{`BWLw$`PE0ww@CtC<*6!ys}{X!`ksouW=cr!2!
z#W{?v%+S@rs*r}HykKr0f=OG}Wthf`Trxli9j2;TQ}b&GXDcI6XRw%(DoG!2c{{QX
zhSIDHkMH|t#ha6}TOVe%*%MvmW-wI^nI5JL$mXkUTcEG0(ZU6DU=B?o0IOcYoCTPF
O#oUoj6eI);5%T~Ca;~=k
literal 0
HcmV?d00001
diff --git a/gdb/testsuite/gdb.arch/i386-biarch-core.exp b/gdb/testsuite/gdb.arch/i386-biarch-core.exp
new file mode 100644
index 0000000..612b4d8
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/i386-biarch-core.exp
@@ -0,0 +1,58 @@
+# Copyright 2015 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# 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"
next prev parent reply other threads:[~2015-02-17 16:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 16:16 Andreas Arnez
2015-01-08 16:43 ` [testsuite patch] for: " Jan Kratochvil
2015-01-09 9:47 ` Andreas Arnez
2015-01-09 16:45 ` Pedro Alves
2015-01-09 16:59 ` Mark Kettenis
2015-01-09 17:19 ` Pedro Alves
2015-01-09 19:35 ` Mark Kettenis
2015-01-09 20:11 ` Pedro Alves
2015-01-09 20:30 ` Mark Kettenis
2015-01-12 14:30 ` Andreas Arnez
2015-01-09 19:27 ` Andreas Arnez
2015-02-05 7:38 ` ping: " Jan Kratochvil
2015-02-05 9:47 ` Pedro Alves
2015-02-14 15:12 ` Jan Kratochvil
2015-02-17 12:56 ` Pedro Alves
2015-02-17 16:56 ` Jan Kratochvil [this message]
2015-02-21 14:28 ` [commit] " Jan Kratochvil
2015-07-14 8:52 ` ping: " Yao Qi
2015-07-14 18:07 ` Jan Kratochvil
2015-07-15 16:14 ` Yao Qi
2015-07-15 16:58 ` Jan Kratochvil
2015-07-16 14:15 ` Yao Qi
2015-07-16 14:37 ` Jan Kratochvil
2015-07-16 15:35 ` Yao Qi
2015-07-16 16:10 ` [commit] " Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150217165629.GA24936@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox