|
|
861f93 |
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
|
|
|
861f93 |
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.exp 2009-04-19 16:30:12.000000000 +0200
|
|
|
861f93 |
@@ -0,0 +1,61 @@
|
|
|
861f93 |
+# This testcase is part of GDB, the GNU debugger.
|
|
|
861f93 |
+
|
|
|
861f93 |
+# Copyright 2009 Free Software Foundation, Inc.
|
|
|
861f93 |
+
|
|
|
861f93 |
+# This program is free software; you can redistribute it and/or modify
|
|
|
861f93 |
+# it under the terms of the GNU General Public License as published by
|
|
|
861f93 |
+# the Free Software Foundation; either version 2 of the License, or
|
|
|
861f93 |
+# (at your option) any later version.
|
|
|
861f93 |
+#
|
|
|
861f93 |
+# This program is distributed in the hope that it will be useful,
|
|
|
861f93 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
861f93 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
861f93 |
+# GNU General Public License for more details.
|
|
|
861f93 |
+#
|
|
|
861f93 |
+# You should have received a copy of the GNU General Public License
|
|
|
861f93 |
+# along with this program; if not, write to the Free Software
|
|
|
861f93 |
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
861f93 |
+
|
|
|
861f93 |
+# Test ability to load an elf64-i386 core file. The provided core file was
|
|
|
861f93 |
+# elf64-x8664 one but it got binary patched to i386:
|
|
|
861f93 |
+# Elf32_Ehdr.e_machine @0x12..0x13
|
|
|
861f93 |
+# Elf64_Ehdr.e_machine @0x12..0x13
|
|
|
861f93 |
+# #define EM_386 3 /* Intel 80386 */
|
|
|
861f93 |
+# #define EM_X86_64 62 /* AMD x86-64 architecture */
|
|
|
861f93 |
+# patch @0x12: 0x3E -> 0x03
|
|
|
861f93 |
+
|
|
|
861f93 |
+if { ![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] } then {
|
|
|
861f93 |
+ verbose "Skipping i386-biarch-core test."
|
|
|
861f93 |
+ return
|
|
|
861f93 |
+}
|
|
|
861f93 |
+
|
|
|
861f93 |
+set testfile "i386-biarch-core"
|
|
|
861f93 |
+set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu
|
|
|
861f93 |
+set corefile ${objdir}/${subdir}/${testfile}.core
|
|
|
861f93 |
+# Entry point of the original executable.
|
|
|
861f93 |
+set address 0x400078
|
|
|
861f93 |
+
|
|
|
861f93 |
+if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} {
|
|
|
861f93 |
+ untested "failed uudecode or bzip2"
|
|
|
861f93 |
+ return -1
|
|
|
861f93 |
+}
|
|
|
861f93 |
+file stat ${corefile} corestat
|
|
|
861f93 |
+if {$corestat(size) != 102400} {
|
|
|
861f93 |
+ untested "uudecode or bzip2 produce invalid result"
|
|
|
861f93 |
+ return -1
|
|
|
861f93 |
+}
|
|
|
861f93 |
+
|
|
|
861f93 |
+gdb_exit
|
|
|
861f93 |
+gdb_start
|
|
|
861f93 |
+gdb_reinitialize_dir $srcdir/$subdir
|
|
|
861f93 |
+
|
|
|
861f93 |
+# Wrongly built GDB complains by:
|
|
|
861f93 |
+# "..." is not a core dump: File format not recognized
|
|
|
861f93 |
+# As the provided test core has 64bit PRSTATUS i386 built GDB cannot parse it.
|
|
|
861f93 |
+# This is just a problem of the test care, real-world elf64-i386 file will have
|
|
|
861f93 |
+# 32bit PRSTATUS. One cannot prepare elf64-i386 core file from elf32-i386 by
|
|
|
861f93 |
+# objcopy as it corrupts the core file beyond all recognition.
|
|
|
861f93 |
+# "\r\nCore was generated by `\[^\r\n\]*'\\.\r\nProgram terminated with signal 11, Segmentation fault\\.\r\n.*"
|
|
|
861f93 |
+gdb_test "core-file ${corefile}"
|
|
|
861f93 |
+
|
|
|
861f93 |
+gdb_test "x/i $address" "\r\n\[ \t\]*$address:\[ \t\]*hlt\[ \t\]*" ".text is readable"
|
|
|
861f93 |
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
|
|
|
861f93 |
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.S 2009-04-19 14:52:28.000000000 +0200
|
|
|
861f93 |
@@ -0,0 +1,22 @@
|
|
|
861f93 |
+/* This testcase is part of GDB, the GNU debugger.
|
|
|
861f93 |
+
|
|
|
861f93 |
+ Copyright 2009 Free Software Foundation, Inc.
|
|
|
861f93 |
+
|
|
|
861f93 |
+ This program is free software; you can redistribute it and/or modify
|
|
|
861f93 |
+ it under the terms of the GNU General Public License as published by
|
|
|
861f93 |
+ the Free Software Foundation; either version 2 of the License, or
|
|
|
861f93 |
+ (at your option) any later version.
|
|
|
861f93 |
+
|
|
|
861f93 |
+ This program is distributed in the hope that it will be useful,
|
|
|
861f93 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
861f93 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
861f93 |
+ GNU General Public License for more details.
|
|
|
861f93 |
+
|
|
|
861f93 |
+ You should have received a copy of the GNU General Public License
|
|
|
861f93 |
+ along with this program; if not, write to the Free Software
|
|
|
861f93 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
861f93 |
+ */
|
|
|
861f93 |
+
|
|
|
861f93 |
+ .globl _start
|
|
|
861f93 |
+_start:
|
|
|
861f93 |
+ hlt
|
|
|
861f93 |
--- /dev/null 2009-04-19 14:49:00.974648389 +0200
|
|
|
861f93 |
+++ gdb-6.8/gdb/testsuite/gdb.arch/i386-biarch-core.core.bz2.uu 2009-04-19 15:02:12.000000000 +0200
|
|
|
861f93 |
@@ -0,0 +1,13 @@
|
|
|
861f93 |
+begin 600 i386-biarch-core.core.bz2
|
|
|
861f93 |
+M0EIH.3%!629361`P1\P`!)?_____\9'@"8Q)6P380'9@'&#`0D@``"``%(``
|
|
|
861f93 |
+M@`#`"!<(L`%F"(:$GH13::F-)M&D&U,AD:`--#)M0&FT0XR9--,)D9`P(Q-&
|
|
|
861f93 |
+M",(-&F``02)%38HT]0T`&AH```'H@``T^>9T*(,("&)SE`>`9@+GP=[,N)KB
|
|
|
861f93 |
+M'I8BL(L]N5TCY\%V]/?DB.BN*UZ'U@]TN7-]UJ5\_%0QTT<*086#%MHT7XVJ
|
|
|
861f93 |
+M9D"+C!"2*L:8D1XPD!`--M@*XT1H5RFYN&)(!0P0#:`I:;2;$5M&\*9"0@%:
|
|
|
861f93 |
+MK@X[T()M)9N7`D$VA!^63)%,;@8LT`(7\K&[7G;U:"B6'!GG+46ALOZF.2F-
|
|
|
861f93 |
+M!@>C*%86X$-]C2`KE;HG)UL(913VR2G]0BD:J=Z_`G@S,`W%.8RMS-#5P:J0
|
|
|
861f93 |
+MAJ2\8&X?@DE;UF68QHM<,D`('::J65/S:PAG*R-09["8DBI)'V]Y.[(/AM*L
|
|
|
861f93 |
+M"X_O^V;%FY.S6Q]FM=D37>5F,%4-F1ZF#,CFJVU;H*^IT<(%
|
|
|
861f93 |
+/G`68?\7
|
|
|
861f93 |
+`
|
|
|
861f93 |
+end
|