From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: Pedro Alves <palves@redhat.com>,
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, 14 Jul 2015 18:07:00 -0000 [thread overview]
Message-ID: <20150714180748.GA13461@host1.jankratochvil.net> (raw)
In-Reply-To: <55A4CDD1.6060907@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1638 bytes --]
Hi Yao,
On Tue, 14 Jul 2015 10:52:33 +0200, Yao Qi wrote:
> this new test fails on i686 buildbot slaves,
>
> (gdb) core-file /home/gdb-buildbot-2/fedora-x86-64-2/fedora-i686/build/gdb/testsuite/gdb.arch/i386-biarch-core.core
> "/home/gdb-buildbot-2/fedora-x86-64-2/fedora-i686/build/gdb/testsuite/gdb.arch/i386-biarch-core.core"
> is not a core dump: File format not recognized
> (gdb) FAIL: gdb.arch/i386-biarch-core.exp: core-file
There are two problems:
(1) The testcase did not really test if elf64-i386 is supported by GDB (BFD).
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
(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.
./configure --enable-64-bit-bfd
(gdb) core-file /home/jkratoch/redhat/gdb-test-build32-plus64/gdb/testsuite/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 <unavailable> 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
OK for check-in a fix for (1) and (2) in this patch?
Jan
[-- Attachment #2: 1 --]
[-- Type: text/plain, Size: 1879 bytes --]
2015-07-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/i386-biarch-core.exp: Replace istarget
by "complete set gnutarget". Remove expectation for the "core-file"
command.
diff --git a/gdb/testsuite/gdb.arch/i386-biarch-core.exp b/gdb/testsuite/gdb.arch/i386-biarch-core.exp
index 60d049b..9e05869 100644
--- a/gdb/testsuite/gdb.arch/i386-biarch-core.exp
+++ b/gdb/testsuite/gdb.arch/i386-biarch-core.exp
@@ -23,9 +23,20 @@
standard_testfile
-if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
- verbose "Skipping i386-biarch-core test."
- return
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+set test "complete set gnutarget"
+gdb_test_multiple "complete set gnutarget " $test {
+ -re "set gnutarget elf64-little\r\n(.*\r\n)?$gdb_prompt $" {
+ pass $test
+ }
+ -re "\r\n$gdb_prompt $" {
+ pass $test
+ untested ".text is readable"
+ return
+ }
}
set corebz2file ${srcdir}/${subdir}/${testfile}.core.bz2
@@ -43,16 +54,12 @@ if {$corestat(size) != 102400} {
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 case, 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 "core-file ${corefile}" ".*" "core-file"
gdb_test "x/i $address" "\r\n\[ \t\]*$address:\[ \t\]*hlt\[ \t\]*" ".text is readable"
next prev parent reply other threads:[~2015-07-14 18:07 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
2015-02-21 14:28 ` [commit] " Jan Kratochvil
2015-07-14 8:52 ` ping: " Yao Qi
2015-07-14 18:07 ` Jan Kratochvil [this message]
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=20150714180748.GA13461@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=qiyaoltc@gmail.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