summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.reverse/singlejmp-reverse.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2012-09-17 07:09:35 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2012-09-17 07:09:35 +0000
commitacf9414f48577b03f303c70f504383709db6a249 (patch)
tree56b3aacf2b20c7fc0604e643828216ad627f160f /gdb/testsuite/gdb.reverse/singlejmp-reverse.c
parent193facb37dbdf7a969ac8c581ec9b3158cfef7ee (diff)
downloadbinutils-gdb-acf9414f48577b03f303c70f504383709db6a249.tar.gz
gdb/
PR 14548 * infrun.c (handle_inferior_event): Do not reverse-continue back to the function start if we are already at function start. Both for reverse-next and for reverse-step into function without line number info. gdb/testsuite/ PR 14548 * gdb.reverse/singlejmp-reverse-nodebug.S: New file. * gdb.reverse/singlejmp-reverse-nodebug.c: New file. * gdb.reverse/singlejmp-reverse.S: New file. * gdb.reverse/singlejmp-reverse.c: New file. * gdb.reverse/singlejmp-reverse.exp: New file.
Diffstat (limited to 'gdb/testsuite/gdb.reverse/singlejmp-reverse.c')
-rw-r--r--gdb/testsuite/gdb.reverse/singlejmp-reverse.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.reverse/singlejmp-reverse.c b/gdb/testsuite/gdb.reverse/singlejmp-reverse.c
new file mode 100644
index 00000000000..c9ebf37451e
--- /dev/null
+++ b/gdb/testsuite/gdb.reverse/singlejmp-reverse.c
@@ -0,0 +1,42 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 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/>. */
+
+volatile int v;
+
+static __attribute__ ((noinline, noclone)) void
+g (void)
+{
+ v = 2;
+}
+
+static __attribute__ ((noinline, noclone)) void
+f (void)
+{
+ g ();
+}
+
+extern void nodebug (void);
+
+int
+main (void)
+{
+ v = 1;
+ f ();
+ nodebug ();
+ v = 3;
+ return 0;
+}