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