aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2009-06-30 16:22:59 +0000
committerPaul Pluzhnikov <ppluzhnikov@google.com>2009-06-30 16:22:59 +0000
commit2fd481e1eabba97b05cb5dbd458b2687798f872f (patch)
tree63f8b27aac33cda0692a1ea690dc5597240cb874 /gdb/testsuite
parentc38f313db7f8010841c0436444b6bde74004a3a3 (diff)
downloadgdb-2fd481e1eabba97b05cb5dbd458b2687798f872f.zip
gdb-2fd481e1eabba97b05cb5dbd458b2687798f872f.tar.gz
gdb-2fd481e1eabba97b05cb5dbd458b2687798f872f.tar.bz2
ChangeLog:
2009-06-30 Paul Pluzhnikov <ppluzhnikov@google.com> gdb/10275 * dwarf2-frame.c (dwarf2_frame_state): Move cfa_offset, cfa_reg, cfa_how and cfa_exp into regs and adjust users. testsuite/ChangeLog: 2009-06-30 Paul Pluzhnikov <ppluzhnikov@google.com> gdb/10275 * gdb.dwarf2/dw2-restore.{S,exp}: New test.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-restore.S50
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-restore.exp37
3 files changed, 92 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index d08158e..a9436f4 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-06-30 Paul Pluzhnikov <ppluzhnikov@google.com>
+
+ gdb/10275
+ * gdb.dwarf2/dw2-restore.{S,exp}: New test.
+
2009-06-30 Daniel Jacobowitz <dan@codesourcery.com>
* gdb.opt/inline-locals.exp: Remove XFAIL with duplicated arg1.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-restore.S b/gdb/testsuite/gdb.dwarf2/dw2-restore.S
new file mode 100644
index 0000000..c268dac
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-restore.S
@@ -0,0 +1,50 @@
+/*
+ Copyright 2009 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 <http://www.gnu.org/licenses/>.
+ */
+
+/* Compile with "gcc -nostdlib dw2-restore.S" */
+
+ .text
+ .globl _start
+ .func _start
+_start: call foo
+ mov $0,%rax
+ ret
+ .endfunc
+
+ .func foo
+foo: .cfi_startproc
+ push %rbp
+ .cfi_adjust_cfa_offset 8
+ mov %rsp,%rbp
+ .cfi_def_cfa_register %rbp
+
+ .cfi_remember_state
+ jmp 2f
+
+1: mov %rbp,%rsp
+ .cfi_restore %rbp
+ pop %rbp
+ .cfi_adjust_cfa_offset -8
+ .cfi_def_cfa_register %rsp
+ ret
+
+ .cfi_restore_state
+2: movq $0,%rax
+ movq $0,(%rax) /* crash here */
+ jmp 1b
+ .cfi_endproc
+ .endfunc
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-restore.exp b/gdb/testsuite/gdb.dwarf2/dw2-restore.exp
new file mode 100644
index 0000000..78994c1
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-restore.exp
@@ -0,0 +1,37 @@
+# Copyright 2009 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 <http://www.gnu.org/licenses/>.
+
+# Test handling of DW_CFA_restore_state.
+
+# This test can only be run on x86_64 targets.
+if {![istarget x86_64-*]} {
+ return 0
+}
+set testfile "dw2-restore"
+set srcfile ${testfile}.S
+set binfile ${objdir}/${subdir}/${testfile}.x
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
+ [list {additional_flags=-nostdlib}]] != "" } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+gdb_test "run" ""
+gdb_test "where" ".*$hex in foo ().+$hex in _start ().*"