1 diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S
2 --- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S 1969-12-31 19:00:00.000000000 -0500
3 +++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm32.S 2007-08-02 13:23:10.000000000 -0400
5 +/* This testcase is part of GDB, the GNU debugger.
7 + Copyright 2007 Free Software Foundation, Inc.
9 + This program is free software; you can redistribute it and/or modify
10 + it under the terms of the GNU General Public License as published by
11 + the Free Software Foundation; either version 2 of the License, or
12 + (at your option) any later version.
14 + This program is distributed in the hope that it will be useful,
15 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 + GNU General Public License for more details.
19 + You should have received a copy of the GNU General Public License
20 + along with this program; if not, write to the Free Software
21 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
26 + .type func0, @function
34 + .size func0, .-func0
37 + .type func1, @function
41 +/* 20 = BO = branch always
42 + 31 = BI = CR bit (ignored) */
59 + .size func1, .-func1
60 + .section .note.GNU-stack,"",@progbits
61 + .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)"
63 +/* Original source file:
67 +extern volatile int var;
69 +int func0 (void) __attribute__((__noinline__));
76 +int func1 (void) __attribute__((__noinline__));
79 + return func0 () + var;
83 diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S
84 --- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S 1969-12-31 19:00:00.000000000 -0500
85 +++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue-asm64.S 2007-08-02 14:28:56.000000000 -0400
87 +/* This testcase is part of GDB, the GNU debugger.
89 + Copyright 2007 Free Software Foundation, Inc.
91 + This program is free software; you can redistribute it and/or modify
92 + it under the terms of the GNU General Public License as published by
93 + the Free Software Foundation; either version 2 of the License, or
94 + (at your option) any later version.
96 + This program is distributed in the hope that it will be useful,
97 + but WITHOUT ANY WARRANTY; without even the implied warranty of
98 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
99 + GNU General Public License for more details.
101 + You should have received a copy of the GNU General Public License
102 + along with this program; if not, write to the Free Software
103 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
105 + .section ".toc","aw"
109 + .section ".opd","aw"
112 + .quad .L.func0,.TOC.@tocbase
114 + .type func0, @function
124 + .byte 0,0,0,1,128,1,0,1
125 + .size func0,.-.L.func0
126 + .section ".toc","aw"
132 + .section ".opd","aw"
135 + .quad .L.func1,.TOC.@tocbase
137 + .type func1, @function
140 +/* 20 = BO = branch always
141 + 31 = BI = CR bit (ignored) */
160 + .byte 0,0,0,1,128,1,0,1
161 + .size func1,.-.L.func1
162 + .section .note.GNU-stack,"",@progbits
163 + .ident "GCC: (GNU) 3.4.6 20060404 (Red Hat 3.4.6-8)"
165 +/* Original source file:
169 +extern volatile int var;
171 +int func0 (void) __attribute__((__noinline__));
178 +int func1 (void) __attribute__((__noinline__));
181 + return func0 () + var;
185 diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c
186 --- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c 1969-12-31 19:00:00.000000000 -0500
187 +++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.c 2007-08-02 13:25:10.000000000 -0400
189 +/* This testcase is part of GDB, the GNU debugger.
191 + Copyright 2007 Free Software Foundation, Inc.
193 + This program is free software; you can redistribute it and/or modify
194 + it under the terms of the GNU General Public License as published by
195 + the Free Software Foundation; either version 2 of the License, or
196 + (at your option) any later version.
198 + This program is distributed in the hope that it will be useful,
199 + but WITHOUT ANY WARRANTY; without even the implied warranty of
200 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
201 + GNU General Public License for more details.
203 + You should have received a copy of the GNU General Public License
204 + along with this program; if not, write to the Free Software
205 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
207 +/* Force `-fpie' double jump bl->blrl. */
208 +/* No longer used. */
211 +extern int func1 (void);
218 diff -u -ruNp gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp
219 --- gdb-6.3-unpatched/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp 1969-12-31 19:00:00.000000000 -0500
220 +++ gdb-6.3/gdb/testsuite/gdb.arch/powerpc-bcl-prologue.exp 2007-08-02 14:21:29.000000000 -0400
222 +# Copyright 2006, 2007 Free Software Foundation, Inc.
224 +# This program is free software; you can redistribute it and/or modify
225 +# it under the terms of the GNU General Public License as published by
226 +# the Free Software Foundation; either version 2 of the License, or
227 +# (at your option) any later version.
229 +# This program is distributed in the hope that it will be useful,
230 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
231 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
232 +# GNU General Public License for more details.
234 +# You should have received a copy of the GNU General Public License
235 +# along with this program; if not, write to the Free Software
236 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
238 +# Test unwinding fixes of the PPC platform, specifically on the coping with BCL
239 +# jump of the PIE code.
241 +if ![istarget "powerpc*-*-linux*"] then {
242 + verbose "Skipping powerpc-linux prologue tests."
246 +set testfile "powerpc-bcl-prologue"
247 +set srcfile1 ${testfile}.c
249 +if [istarget "powerpc-*"] then {
250 + set srcfile2 ${testfile}-asm32.S
251 + set flags "$flags additional_flags=-m32"
252 +} elseif [istarget "powerpc64-*"] then {
253 + set srcfile2 ${testfile}-asm64.S
254 + set flags "$flags additional_flags=-m64"
256 + fail "powerpc arch test"
259 +set objfile2 ${objdir}/${subdir}/${testfile}-asm.o
260 +set binfile ${objdir}/${subdir}/${testfile}
262 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${srcdir}/${subdir}/${srcfile2}" ${binfile} executable $flags] != ""} {
268 +gdb_reinitialize_dir $srcdir/$subdir
271 +# We should stop in abort(3).
275 +gdb_test_multiple {} "continue to abort()" {
276 + -re ".*Program received signal SIGABRT,.*$gdb_prompt $" {
277 + pass "continue to abort()"
282 +# #3 0x0804835f in func0 ()
283 +# #4 0x0804836a in func1 ()
284 +# #5 0x0804838c in main ()
286 +# `\\.?' prefixes are needed for ppc64 without `debug' (another bug).
288 +set test "matching unwind"
289 +gdb_test_multiple "backtrace" $test {
290 + -re "\r\n#\[0-9\]\[^\r\n\]* in \\.?func0 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?func1 \\(\[^\r\n\]*\r\n#\[0-9\]\[^\r\n\]* in \\.?main \\(\[^\r\n\]*\r\n$gdb_prompt $" {
295 Fixup the testcase for ppc64 biarch GDB.
297 --- ./gdb/testsuite/gdb.arch/powerpc-prologue.exp 2008-01-13 13:32:19.000000000 +0100
298 +++ ./gdb/testsuite/gdb.arch/powerpc-prologue.exp 2008-01-02 00:04:10.000000000 +0100
300 # Test PowerPC prologue analyzer.
302 # Do not run on AIX (where we won't be able to build the tests without
303 -# some surgery) or on PowerPC64 (ditto, dot symbols).
304 -if {[istarget *-*-aix*] || ![istarget "powerpc-*-*"]} then {
305 +# some surgery). PowerPC64 target would break due to dot symbols but we build
306 +# there PowerPC32 inferior.
307 +if {[istarget *-*-aix*] || ![istarget "powerpc*-*-*"]} then {
308 verbose "Skipping PowerPC prologue tests."