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