aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2014-01-29 07:15:05 -0800
committerJose E. Marchesi <jose.marchesi@oracle.com>2014-01-29 07:15:05 -0800
commit401e27fd717fcbc2efe00e332bdaa46846501323 (patch)
tree7e0f672777edfae3deda9b72f31360a7587357d5 /gdb/testsuite
parentdf3ce959f4f4598f73c4e02f45e65ad1fd6f4f7c (diff)
downloadgdb-401e27fd717fcbc2efe00e332bdaa46846501323.zip
gdb-401e27fd717fcbc2efe00e332bdaa46846501323.tar.gz
gdb-401e27fd717fcbc2efe00e332bdaa46846501323.tar.bz2
This changeset makes sparc64_linux_step_trap to return 0 when a
breakpoint is set in a `ta 0x6d´ which is not a sigreturn syscall. In these cases no rt_frame exists in the stack and thus the read PC is wrong. ChangeLog 2014-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * sparc64-linux-tdep.c (sparc64_linux_step_trap): Get PC from the sigreturn register save area only if the syscall is sigreturn. testsuite/ChangeLog 2014-01-29 Jose E. Marchesi <jose.marchesi@oracle.com> * gdb.arch/sparc-sysstep.exp: New file. * gdb.arch/sparc-sysstep.c: Likewise. * gdb.arch/Makefile.in (EXECUTABLES): Add sparc-sysstep.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.arch/Makefile.in2
-rw-r--r--gdb/testsuite/gdb.arch/sparc-sysstep.c35
-rw-r--r--gdb/testsuite/gdb.arch/sparc-sysstep.exp49
4 files changed, 92 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 58361ef..e2c1bc8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2014-01-29 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * gdb.arch/sparc-sysstep.exp: New file.
+ * gdb.arch/sparc-sysstep.c: Likewise.
+
+ * gdb.arch/Makefile.in (EXECUTABLES): Add sparc-sysstep.
+
2014-01-28 Edjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
* gdb.base/info-shared.exp: Expect leading `.' on ppc64's symbols.
diff --git a/gdb/testsuite/gdb.arch/Makefile.in b/gdb/testsuite/gdb.arch/Makefile.in
index e5f8934..658c7ad 100644
--- a/gdb/testsuite/gdb.arch/Makefile.in
+++ b/gdb/testsuite/gdb.arch/Makefile.in
@@ -3,7 +3,7 @@ srcdir = @srcdir@
EXECUTABLES = altivec-abi altivec-regs amd64-byte amd64-disp-step amd64-dword \
amd64-entry-value amd64-i386-address amd64-word i386-bp_permanent \
- i386-permbkpt i386-avx i386-signal i386-sse
+ i386-permbkpt i386-avx i386-signal i386-sse sparc-sysstep
all info install-info dvi install uninstall installcheck check:
@echo "Nothing to be done for $@..."
diff --git a/gdb/testsuite/gdb.arch/sparc-sysstep.c b/gdb/testsuite/gdb.arch/sparc-sysstep.c
new file mode 100644
index 0000000..911fcbd
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/sparc-sysstep.c
@@ -0,0 +1,35 @@
+/* Test single-stepping system call instructions in sparc.
+
+ Copyright 2014 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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/>. */
+
+#include <signal.h>
+
+int global;
+
+static void
+handler (int sig)
+{
+}
+
+int
+main ()
+{
+ signal (SIGALRM, handler);
+ kill (getpid (), SIGALRM);
+ return 0; /* sparc-sysstep.exp: last */
+}
diff --git a/gdb/testsuite/gdb.arch/sparc-sysstep.exp b/gdb/testsuite/gdb.arch/sparc-sysstep.exp
new file mode 100644
index 0000000..ac840f5
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/sparc-sysstep.exp
@@ -0,0 +1,49 @@
+# Copyright 2014 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/>.
+#
+# This file is part of the gdb testsuite.
+
+# Test single-stepping system call instructions (ta 0x6d) in the two
+# cases distinguished by the implementation: sigreturn and all others.
+# The sigreturn syscall requires a special analysis since the return
+# PC must be extracted from the sigreturn register save area in the
+# stack.
+
+if ![istarget "sparc*-*-linux*"] then {
+ return 0
+}
+
+set testfile sparc-sysstep
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+set opts {}
+
+if {[prepare_for_testing ${testfile}.exp ${binfile} $srcfile {additional_flags=-g}]} {
+ return -1
+}
+
+if ![runto_main] {
+ return -1
+}
+
+# Watching the global variable will guarantee that gdb will
+# single-step through the whole program.
+
+set lno [gdb_get_line_number "sparc-sysstep.exp: last" $srcfile]
+
+gdb_test "break $srcfile:$lno" "Breakpoint \[0-9\] at .*"
+gdb_test_no_output "set can-use-hw-watchpoints 0" ""
+gdb_test "watch global" "Watchpoint .*: global"
+gdb_test "continue" "Continuing.*${srcfile}:${lno}.*"