|
|
861f93 |
2007-11-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
861f93 |
|
|
|
861f93 |
* gdb.arch/ppc-clobbered-registers-O2.exp: `powerpc64' changed to
|
|
|
861f93 |
`powerpc*'.
|
|
|
861f93 |
|
|
|
861f93 |
Testcase for:
|
|
|
861f93 |
|
|
|
861f93 |
http://sourceware.org/ml/gdb-patches/2007-09/msg00228.html
|
|
|
861f93 |
|
|
|
861f93 |
2007-10-21 Luis Machado <luisgpm@br.ibm.com>
|
|
|
861f93 |
|
|
|
861f93 |
* rs6000-tdep.c (ppc_dwarf2_frame_init_reg): New function.
|
|
|
861f93 |
* (rs6000_gdbarch_init): Install ppc_dwarf2_frame_init_reg as
|
|
|
861f93 |
default dwarf2_frame_set_init_reg function.
|
|
|
861f93 |
|
|
|
861f93 |
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
|
|
861f93 |
+++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.c 3 Nov 2007 22:22:28 -0000
|
|
|
861f93 |
@@ -0,0 +1,21 @@
|
|
|
861f93 |
+
|
|
|
861f93 |
+unsigned * __attribute__((noinline))
|
|
|
861f93 |
+start_sequence (unsigned * x, unsigned * y)
|
|
|
861f93 |
+{
|
|
|
861f93 |
+ return (unsigned *)0xdeadbeef;
|
|
|
861f93 |
+};
|
|
|
861f93 |
+
|
|
|
861f93 |
+unsigned __attribute__((noinline))
|
|
|
861f93 |
+gen_movsd (unsigned * operand0, unsigned * operand1)
|
|
|
861f93 |
+{
|
|
|
861f93 |
+ return *start_sequence(operand0, operand1);
|
|
|
861f93 |
+}
|
|
|
861f93 |
+
|
|
|
861f93 |
+int main(void)
|
|
|
861f93 |
+{
|
|
|
861f93 |
+ unsigned x, y;
|
|
|
861f93 |
+
|
|
|
861f93 |
+ x = 13;
|
|
|
861f93 |
+ y = 14;
|
|
|
861f93 |
+ return (int)gen_movsd (&x, &y);
|
|
|
861f93 |
+}
|
|
|
861f93 |
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
|
|
861f93 |
+++ ./gdb/testsuite/gdb.arch/ppc-clobbered-registers-O2.exp 3 Nov 2007 22:22:28 -0000
|
|
|
861f93 |
@@ -0,0 +1,54 @@
|
|
|
861f93 |
+# Copyright 2006 Free Software Foundation, Inc.
|
|
|
861f93 |
+#
|
|
|
861f93 |
+# This program is free software; you can redistribute it and/or modify
|
|
|
861f93 |
+# it under the terms of the GNU General Public License as published by
|
|
|
861f93 |
+# the Free Software Foundation; either version 2 of the License, or
|
|
|
861f93 |
+# (at your option) any later version.
|
|
|
861f93 |
+#
|
|
|
861f93 |
+# This program is distributed in the hope that it will be useful,
|
|
|
861f93 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
861f93 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
861f93 |
+# GNU General Public License for more details.
|
|
|
861f93 |
+#
|
|
|
861f93 |
+# You should have received a copy of the GNU General Public License
|
|
|
861f93 |
+# along with this program; if not, write to the Free Software
|
|
|
861f93 |
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
861f93 |
+#
|
|
|
861f93 |
+# This file is part of the gdb testsuite.
|
|
|
861f93 |
+
|
|
|
861f93 |
+# Test displaying call clobbered registers in optimized binaries for ppc.
|
|
|
861f93 |
+# GDB should not show incorrect values.
|
|
|
861f93 |
+
|
|
|
861f93 |
+if ![istarget "powerpc*-*"] then {
|
|
|
861f93 |
+ verbose "Skipping powerpc* call clobbered registers testing."
|
|
|
861f93 |
+ return
|
|
|
861f93 |
+}
|
|
|
861f93 |
+
|
|
|
861f93 |
+set testfile "ppc-clobbered-registers-O2"
|
|
|
861f93 |
+set srcfile ${testfile}.c
|
|
|
861f93 |
+set binfile ${objdir}/${subdir}/${testfile}
|
|
|
861f93 |
+set compile_flags "debug additional_flags=-O2"
|
|
|
861f93 |
+
|
|
|
861f93 |
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable ${compile_flags}] != "" } {
|
|
|
861f93 |
+ unsupported "Testcase compile failed."
|
|
|
861f93 |
+ return -1
|
|
|
861f93 |
+}
|
|
|
861f93 |
+
|
|
|
861f93 |
+gdb_exit
|
|
|
861f93 |
+gdb_start
|
|
|
861f93 |
+gdb_reinitialize_dir $srcdir/$subdir
|
|
|
861f93 |
+gdb_load ${binfile}
|
|
|
861f93 |
+
|
|
|
861f93 |
+if ![runto_main] then {
|
|
|
861f93 |
+ perror "Couldn't run to breakpoint"
|
|
|
861f93 |
+ continue
|
|
|
861f93 |
+}
|
|
|
861f93 |
+
|
|
|
861f93 |
+gdb_test "b start_sequence" ".*Breakpoint 2 at.*line 6.*" \
|
|
|
861f93 |
+ "Insert breakpoint at problematic function"
|
|
|
861f93 |
+
|
|
|
861f93 |
+gdb_test continue ".*Breakpoint 2.*in start_sequence.*" \
|
|
|
861f93 |
+ "Run until problematic function"
|
|
|
861f93 |
+
|
|
|
861f93 |
+gdb_test backtrace ".*operand0=<value optimized out>.*operand1=<value optimized out>.*" \
|
|
|
861f93 |
+ "Check value of call clobbered registers"
|