Blame SOURCES/gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch

a1b30c
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
a1b30c
From: Fedora GDB patches <invalid@email.com>
a1b30c
Date: Fri, 27 Oct 2017 21:07:50 +0200
a1b30c
Subject: gdb-rhbz1084404-ppc64-s390x-wrong-prologue-skip-O2-g-3of3.patch
a1b30c
a1b30c
;; Fix '[ppc64] and [s390x] wrong prologue skip on -O2 -g code' (Jan
a1b30c
;; Kratochvil, RH BZ 1084404).
a1b30c
;;=fedoratest
a1b30c
a1b30c
These testcases have been created by compiling glibc-2.17-78 on
a1b30c
RHEL-7.1 s390x/ppc64 boxes, and then taking the "select.o" file
a1b30c
present at $builddir/misc/select.o.
a1b30c
a1b30c
diff --git a/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp
a1b30c
new file mode 100644
a1b30c
--- /dev/null
a1b30c
+++ b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.exp
a1b30c
@@ -0,0 +1,34 @@
a1b30c
+# Copyright 2015 Free Software Foundation, Inc.
a1b30c
+
a1b30c
+# This program is free software; you can redistribute it and/or modify
a1b30c
+# it under the terms of the GNU General Public License as published by
a1b30c
+# the Free Software Foundation; either version 3 of the License, or
a1b30c
+# (at your option) any later version.
a1b30c
+#
a1b30c
+# This program is distributed in the hope that it will be useful,
a1b30c
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1b30c
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1b30c
+# GNU General Public License for more details.
a1b30c
+#
a1b30c
+# You should have received a copy of the GNU General Public License
a1b30c
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
a1b30c
+
a1b30c
+if { ![istarget powerpc64-*linux-*] || ![is_lp64_target] } {
a1b30c
+    verbose "Skipping ppc64-prologue-skip.exp"
a1b30c
+    return
a1b30c
+}
a1b30c
+
a1b30c
+set testfile "ppc64-prologue-skip"
a1b30c
+set uufile "${srcdir}/${subdir}/${testfile}.o.uu"
a1b30c
+set ofile "${srcdir}/${subdir}/${testfile}.o"
a1b30c
+
a1b30c
+if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } {
a1b30c
+    untested "failed uudecode"
a1b30c
+    return -1
a1b30c
+}
a1b30c
+
a1b30c
+gdb_exit
a1b30c
+gdb_start
a1b30c
+gdb_load $ofile
a1b30c
+
a1b30c
+gdb_test "break ___newselect_nocancel" "Breakpoint $decimal at 0xc: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on ___newselect_nocancel"
a1b30c
diff --git a/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu
a1b30c
new file mode 100644
a1b30c
--- /dev/null
a1b30c
+++ b/gdb/testsuite/gdb.arch/ppc64-prologue-skip.o.uu
a1b30c
@@ -0,0 +1,70 @@
a1b30c
+begin 644 ppc64-skip-prologue.o.uu
a1b30c
+M?T5,1@("`0`````````````!`!4````!````````````````````````````
a1b30c
+M``-(``````!```````!``!0`$8%-B-`L"@``0,(`-#@``(Y$```"3.,`('P(
a1b30c
+M`J;X`0`0^"'_D4@```%@````Z`$`@#@A`'!\"`.F3H``(/@A_X%]*`*F^2$`
a1b30c
+MD/CA`-#XP0#(^*$`P/B!`+CX80"P2````6````#X80!PZ.$`T.C!`,CHH0#`
a1b30c
+MZ($`N.AA`+`X``".1````GP``";X80!X^`$`B.AA`'!(```!8````.DA`)#H
a1b30c
+M`0"(Z&$`>'TH`Z9\#_$@."$`@$SC`"!+__]@```````,($``````````O``(
a1b30c
+M7U]S96QE8W0```````````````````````````!6``(````Y!`'[#@T``0$!
a1b30c
+M`0````$```$N+B]S>7-D97!S+W5N:7@``'-Y
a1b30c
+M``````D"```````````#T``!`BT3`@D``0$```"/``(`````"`$`````````
a1b30c
+M`````````````````"XN+W-Y<V1E<',O=6YI>"]S>7-C86QL+71E;7!L871E
a1b30c
+M+E,`+W)O;W0O9VQI8F,O9VQI8F,M,BXQ-RTW."YE;#
a1b30c
+M,3
a1b30c
+M$@$#"!L()0@3!0`````````````````L``(`````"```````````````````
a1b30c
+M````````V``````````````````````````0``````%Z4@`$>$$!&PP!````
a1b30c
+M`#`````8`````````+P`20YP$4%^1`X`009!0@Z``4(107Y2$49_20X`!D$&
a1b30c
+M1@``````+G-Y;71A8@`N
a1b30c
+M871A`"YB
a1b30c
+M9U]L:6YE`"YR96QA+F1E8G5G7VEN9F\`+F1E8G5G7V%B8G)E=@`N
a1b30c
+M96)U9U]A
a1b30c
+M````````````````````````````````````````````````````````````
a1b30c
+M`````````"`````!``````````8```````````````````!``````````-@`
a1b30c
+M```````````````````$```````````````;````!```````````````````
a1b30c
+M```````````*>`````````!(````$@````$`````````"``````````8````
a1b30c
+M)@````$``````````P```````````````````1@`````````````````````
a1b30c
+M``````````$``````````````"P````(``````````,`````````````````
a1b30c
+M``$8```````````````````````````````!```````````````V`````0``
a1b30c
+M```````#```````````````````!&``````````0````````````````````
a1b30c
+M"```````````````,0````0`````````````````````````````"L``````
a1b30c
+M````,````!(````%``````````@`````````&````#L````!````````````
a1b30c
+M``````````````````$H```````````````````````````````!````````
a1b30c
+M``````!0`````0`````````````````````````````!*`````````!:````
a1b30c
+M`````````````````0``````````````2P````0`````````````````````
a1b30c
+M````````"O``````````&````!(````(``````````@`````````&````&$`
a1b30c
+M```!``````````````````````````````&"`````````),`````````````
a1b30c
+M```````!``````````````!<````!``````````````````````````````+
a1b30c
+M"`````````!@````$@````H`````````"``````````8````;0````$`````
a1b30c
+M`````````````````````````A4`````````%`````````````````````$`
a1b30c
+M`````````````(`````!``````````````````````````````(P````````
a1b30c
+M`#`````````````````````0``````````````![````!```````````````
a1b30c
+M```````````````+:``````````P````$@````T`````````"``````````8
a1b30c
+M````E`````$``````````@```````````````````F``````````2```````
a1b30c
+M``````````````@``````````````(\````$````````````````````````
a1b30c
+M``````N8`````````!@````2````#P`````````(`````````!@````1````
a1b30c
+M`P`````````````````````````````"J`````````">````````````````
a1b30c
+M`````0```````````````0````(`````````````````````````````"$@`
a1b30c
+M```````!L````!,````+``````````@`````````&`````D````#````````
a1b30c
+M``````````````````````GX`````````'H````````````````````!````
a1b30c
+M`````````````````````````````````````````````P```0``````````
a1b30c
+M`````````````````P```P```````````````````````````P``!```````
a1b30c
+M`````````````````````P``!0```````````````````````````P``"@``
a1b30c
+M`````````````````````````P``#````````````````````````````P``
a1b30c
+M"````````````````````````````P``#0``````````````````````````
a1b30c
+M`P``#P```````````````````````````P``!P``````````````````````
a1b30c
+M```!$@``!0```````````````````-@````*$@```0`````````,````````
a1b30c
+M`#`````@$``````````````````````````````P$```````````````````
a1b30c
+M``````````!*$`````````````````````````````!E(@``!0``````````
a1b30c
+M`````````-@```!S(@``!0```````````````````-@`7U]S96QE8W0`7U]?
a1b30c
+M;F5W
a1b30c
+M8FQE7V%S>6YC8V%N8V5L`%]?;&EB8U]D:7-A8FQE7V%S>6YC8V%N8V5L`%]?
a1b30c
+M;&EB8U]S96QE8W0`
a1b30c
+M``````````````!<````#@````H```````````````````"4````#P````H`
a1b30c
+M`````````````````````````0```"8````````````````````(````````
a1b30c
+M`#,```````````````````!&`````0```"8````````````````````&````
a1b30c
+M!@````$````````````````````,````!P````$````````````````````0
a1b30c
+M`````0```"8````````````````````8`````0```"8`````````V```````
a1b30c
+M```&````!0````$````````````````````0`````0```"8`````````````
a1b30c
+6```````<`````0```!H`````````````
a1b30c
+`
a1b30c
+end
a1b30c
diff --git a/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp b/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp
a1b30c
new file mode 100644
a1b30c
--- /dev/null
a1b30c
+++ b/gdb/testsuite/gdb.arch/s390x-prologue-skip.exp
a1b30c
@@ -0,0 +1,34 @@
a1b30c
+# Copyright 2015 Free Software Foundation, Inc.
a1b30c
+
a1b30c
+# This program is free software; you can redistribute it and/or modify
a1b30c
+# it under the terms of the GNU General Public License as published by
a1b30c
+# the Free Software Foundation; either version 3 of the License, or
a1b30c
+# (at your option) any later version.
a1b30c
+#
a1b30c
+# This program is distributed in the hope that it will be useful,
a1b30c
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
a1b30c
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
a1b30c
+# GNU General Public License for more details.
a1b30c
+#
a1b30c
+# You should have received a copy of the GNU General Public License
a1b30c
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
a1b30c
+
a1b30c
+if { ![istarget s390x-*linux-*] || ![is_lp64_target] } {
a1b30c
+    verbose "Skipping s390x-prologue-skip.exp"
a1b30c
+    return
a1b30c
+}
a1b30c
+
a1b30c
+set testfile "s390x-prologue-skip"
a1b30c
+set uufile "${srcdir}/${subdir}/${testfile}.o.uu"
a1b30c
+set ofile "${srcdir}/${subdir}/${testfile}.o"
a1b30c
+
a1b30c
+if { [catch "system \"uudecode -o ${ofile} ${uufile}\"" ] != 0 } {
a1b30c
+    untested "failed uudecode"
a1b30c
+    return -1
a1b30c
+}
a1b30c
+
a1b30c
+gdb_exit
a1b30c
+gdb_start
a1b30c
+gdb_load $ofile
a1b30c
+
a1b30c
+gdb_test "break select" "Breakpoint $decimal at 0x48: file ../sysdeps/unix/syscall-template.S, line 81." "breakpoint on select"
a1b30c
diff --git a/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu b/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu
a1b30c
new file mode 100644
a1b30c
--- /dev/null
a1b30c
+++ b/gdb/testsuite/gdb.arch/s390x-prologue-skip.o.uu
a1b30c
@@ -0,0 +1,64 @@
a1b30c
+begin 644 s390x-prologue-skip.o.uu
a1b30c
+M?T5,1@("`0`````````````!`!8````!````````````````````````````
a1b30c
+M``+```````!```````!``!(`#^LE\!``).O?\&@`)+D$`.^G^_]@X^#P```D
a1b30c
+MP.4`````N00``NLE\+``!`J.N00`TKD$`"#`Y0````"Y!``MZ]_Q"``$I_0`
a1b30c
+M"L`0`````+\/$`"G=/_7"HZG2?`!N2$`),"T``````?^````5@`"````.0$!
a1b30c
+M^PX-``$!`0$````!```!+BXO<WES9&5P<R]U;FEX``!S>7-C86QL+71E;7!L
a1b30c
+M871E+E,``0`````)`@```````````]```0)F$P("``$!````CP`"``````@!
a1b30c
+M```````````````````````````N+B]S>7-D97!S+W5N:7@O
a1b30c
+M96UP;&%T92Y3`"]R;V]T+V=L:6)C+V=L:6)C+3(N,3
a1b30c
+M;&EB8RTR+C$W+6,W-3AA-C@V+VUI
a1b30c
+M`1$`$`81`1(!`P@;""4($P4`````````````````+``"``````@`````````
a1b30c
+M`````````````````&@`````````````````````````%``````!>E(``7@.
a1b30c
+M`1L,#Z`!````````&````!P`````````1`!,CP6.!HT'2`[``@```!`````X
a1b30c
+M`````````"```````"YS>6UT86(`+G-T
a1b30c
+M=&5X=``N9&%T80`N8G-S`"YN;W1E+D=.52US=&%C:P`N
a1b30c
+M:6YE`"YR96QA+F1E8G5G7VEN9F\`+F1E8G5G7V%B8G)E=@`N
a1b30c
+M9U]A
a1b30c
+M````````````````````````````````````````````````````````````
a1b30c
+M````````(`````$`````````!@```````````````````$``````````:```
a1b30c
+M``````````````````0``````````````!L````$````````````````````
a1b30c
+M``````````F``````````&`````0`````0`````````(`````````!@````F
a1b30c
+M`````0`````````#````````````````````J```````````````````````
a1b30c
+M````````!```````````````+`````@``````````P``````````````````
a1b30c
+M`*@```````````````````````````````0``````````````#$````!````
a1b30c
+M``````````````````````````"H```````````````````````````````!
a1b30c
+M``````````````!&`````0``````````````````````````````J```````
a1b30c
+M``!:`````````````````````0``````````````00````0`````````````
a1b30c
+M````````````````">``````````&````!`````&``````````@`````````
a1b30c
+M&````%<````!``````````````````````````````$"`````````),`````
a1b30c
+M```````````````!``````````````!2````!```````````````````````
a1b30c
+M```````)^`````````!@````$`````@`````````"``````````8````8P``
a1b30c
+M``$``````````````````````````````94`````````%```````````````
a1b30c
+M``````$``````````````'8````!``````````````````````````````&P
a1b30c
+M`````````#`````````````````````0``````````````!Q````!```````
a1b30c
+M```````````````````````*6``````````P````$`````L`````````"```
a1b30c
+M```````8````B@````$``````````@```````````````````>``````````
a1b30c
+M2`````````````````````@``````````````(4````$````````````````
a1b30c
+M``````````````J(`````````#`````0````#0`````````(`````````!@`
a1b30c
+M```1`````P`````````````````````````````"*`````````"4````````
a1b30c
+M`````````````0```````````````0````(`````````````````````````
a1b30c
+M````!T`````````!L````!$````*``````````@`````````&`````D````#
a1b30c
+M``````````````````````````````CP`````````(X`````````````````
a1b30c
+M```!`````````````````````````````````````````````````P```0``
a1b30c
+M`````````````````````````P```P```````````````````````````P``
a1b30c
+M!````````````````````````````P``"```````````````````````````
a1b30c
+M`P``"@```````````````````````````P``!@``````````````````````
a1b30c
+M`````P``"P```````````````````````````P``#0``````````````````
a1b30c
+M`````````P``!0`````````````````````````!$```````````````````
a1b30c
+M```````````;$``````````````````````````````V$@```0````````!(
a1b30c
+M`````````"`````_$`````````````````````````````!7$@```0``````
a1b30c
+M``!6`````````!````!I$`````````````````````````````!Y(@```0``
a1b30c
+M``````!(`````````"````"'(@```0````````!(`````````"``7U]L:6)C
a1b30c
+M7V5N86)L95]A
a1b30c
+M;`!?7W-E;&5C=`!?7VQI8F-?;75L=&EP;&5?=&AR96%D
a1b30c
+M;V-A;F-E;`!?7W-Y
a1b30c
+M````````````'`````H````3``````````(`````````-@````L````3````
a1b30c
+M``````(`````````2@````T````3``````````(`````````8@````\````3
a1b30c
+M``````````(`````````1@````$````6````````````````````!@````4`
a1b30c
+M```$````````````````````#`````8````$````````````````````$```
a1b30c
+M``$````6````````````````````&`````$````6`````````&@`````````
a1b30c
+M!@````0````$````````````````````$`````$````6````````````````
a1b30c
+L````(`````$````%````````````````````/`````$````%`````````$@`
a1b30c
+`
a1b30c
+end