Jan Kratochvil 278e869
https://bugzilla.redhat.com/show_bug.cgi?id=611435
Jan Kratochvil 278e869
Jan Kratochvil 278e869
Fix:
Jan Kratochvil 278e869
Re: [RFA]corelow.c: Add tid to add_to_thread_list
Jan Kratochvil 278e869
http://sourceware.org/ml/gdb-patches/2010-08/msg00085.html
Jan Kratochvil 278e869
http://sourceware.org/ml/gdb-cvs/2010-08/msg00026.html
Jan Kratochvil 278e869
2e5bcfdef1ec3883d48c3f87a4be5c0dff25e17e
Jan Kratochvil 278e869
Jan Kratochvil 278e869
--- /dev/null
Jan Kratochvil 278e869
+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu
Jan Kratochvil 278e869
@@ -0,0 +1,20 @@
Jan Kratochvil 278e869
+begin 600 x86_64-pid0-core.core.bz2
Jan Kratochvil 278e869
+M0EIH.3%!629362,CA>P!$/'_____^*#EZ-A!SP36P&_:G0#=14``04A&8,'U
Jan Kratochvil 278e869
+M2*9`>$$)P`*RN"#*;#4R()IJ8C$TT&FC3$&@`T`#:C1H8C0T,@,FC,D"4T2!
Jan Kratochvil 278e869
+M"/2CU'B90]31ZAD#U`&AZF@/4:``!HT&F@!H<`#0-`-#0``#3$-&F@```#0R
Jan Kratochvil 278e869
+M``#")2FD]2>4]0TTT-!HTT--,0,"#$`R!I@AD`#1H,3&GZT.4TO$#H40/`0C
Jan Kratochvil 278e869
+M2$IRXS,<55!8T,&&,R.Z441"?J9I%G6GUA2!.[]Z"C5S[&19,%VS7E6[3"60
Jan Kratochvil 278e869
+M@`-*2G)QEQ(;?0Y<=MK]/U?Q)LB%+F37TJ9BI*46)H'*Z@V"`"$"P7]&
Jan Kratochvil 278e869
+M>XZ:JE0E<*:#1M$P3G]>VCI)(A!O$64`5$4`E$$-.``7&(09`8HO`B6K!Q^&
Jan Kratochvil 278e869
+M562%N)2+0@*HB@%D@5$%!*0!L1&0D4D6\:-$A`)`+<6D82PP*H(J(H!?F;0$
Jan Kratochvil 278e869
+M%PXB7N!2D4!44`W7"ADEQM6
Jan Kratochvil 278e869
+M8"W*_;DV<AN#,XRU]Q-J2FDAFKAQ(9A+ZK$MCY#EI8:W-(15>O9TBO5,_]1)
Jan Kratochvil 278e869
+M($Q2))#),UE,QQK)E$,3D\W.>!4)QO8A_@^Z_SXS
Jan Kratochvil 278e869
+MW+@WN)O)YO;3:I9YW-A$)N'2
Jan Kratochvil 278e869
+M,JV"N(Z:@0E#)50BSF)$T6_IN)#"Z8PLQ4UQ9]@Z'+;T]990-:Y:2`P26#!D
Jan Kratochvil 278e869
+MV+0L6"X@C9`GHAGSY7)%LWOY+E[2/>4;Q8=HV6[:&$@2$@$R29IBW)K%3"O`
Jan Kratochvil 278e869
+M9^Y0YJ&BXY1U2HTZ5)2H-V\_(.DZHWE+C#WS($(!I"3CUH2#(+(OWUV"*<<9
Jan Kratochvil 278e869
+MJ%A!J[%O.P&V%GI.`L7<1@0>,^1F\MY=V5UT,&NOG%7TTZ[03!@BHB@&)
Jan Kratochvil 278e869
+4B.Z!/,0-IZ^W_Q=R13A0D",CA>P`
Jan Kratochvil 278e869
+`
Jan Kratochvil 278e869
+end
Jan Kratochvil 278e869
--- /dev/null
Jan Kratochvil 278e869
+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp
Jan Kratochvil 278e869
@@ -0,0 +1,46 @@
Jan Kratochvil 278e869
+# This testcase is part of GDB, the GNU debugger.
Jan Kratochvil 278e869
+# 
Jan Kratochvil 278e869
+# Copyright 2010 Free Software Foundation, Inc.
Jan Kratochvil 278e869
+# 
Jan Kratochvil 278e869
+# This program is free software; you can redistribute it and/or modify
Jan Kratochvil 278e869
+# it under the terms of the GNU General Public License as published by
Jan Kratochvil 278e869
+# the Free Software Foundation; either version 2 of the License, or
Jan Kratochvil 278e869
+# (at your option) any later version.
Jan Kratochvil 278e869
+# 
Jan Kratochvil 278e869
+# This program is distributed in the hope that it will be useful,
Jan Kratochvil 278e869
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
Jan Kratochvil 278e869
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Jan Kratochvil 278e869
+# GNU General Public License for more details.
Jan Kratochvil 278e869
+# 
Jan Kratochvil 278e869
+# You should have received a copy of the GNU General Public License
Jan Kratochvil 278e869
+# along with this program; if not, write to the Free Software
Jan Kratochvil 278e869
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
Jan Kratochvil 278e869
+
Jan Kratochvil 278e869
+# Some kernel core files have PID 0 - for the idle task.
Jan Kratochvil 278e869
+
Jan Kratochvil 278e869
+if ![istarget "x86_64-*-*"] {
Jan Kratochvil 278e869
+    verbose "Skipping x86_64-pid0-core test."
Jan Kratochvil 278e869
+    return
Jan Kratochvil 278e869
+}
Jan Kratochvil 278e869
+
Jan Kratochvil 278e869
+set testfile "x86_64-pid0-core"
Jan Kratochvil 278e869
+set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu
Jan Kratochvil 278e869
+set corefile ${objdir}/${subdir}/${testfile}.core
Jan Kratochvil 278e869
+
Jan Kratochvil 278e869
+if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} {
Jan Kratochvil 278e869
+    untested "failed uudecode or bzip2"
Jan Kratochvil 278e869
+    return -1
Jan Kratochvil 278e869
+}
Jan Kratochvil 278e869
+file stat ${corefile} corestat
Jan Kratochvil 278e869
+if {$corestat(size) != 8798208} {
Jan Kratochvil 278e869
+    untested "uudecode or bzip2 produce invalid result"
Jan Kratochvil 278e869
+    return -1
Jan Kratochvil 278e869
+}
Jan Kratochvil 278e869
+
Jan Kratochvil 278e869
+gdb_exit
Jan Kratochvil 278e869
+gdb_start
Jan Kratochvil 278e869
+gdb_reinitialize_dir $srcdir/$subdir
Jan Kratochvil 278e869
+
Jan Kratochvil 278e869
+# Former crash was:
Jan Kratochvil 278e869
+# thread.c:884: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
Jan Kratochvil 278e869
+gdb_test "core-file ${corefile}" "Program terminated with signal 11, Segmentation fault\\.\r\n.*"