summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@specifix.com>2008-09-02 00:49:38 +0000
committerMichael Snyder <msnyder@specifix.com>2008-09-02 00:49:38 +0000
commitf231ea7fcd9fcccc2d41995bedee3dcfc316d1e9 (patch)
tree9b2d87a4e5eff99baab2760597ac1be8ad2927d2
parente6d35bc5270a81e187cc1d45459912aa34025ac5 (diff)
downloadgdb-f231ea7fcd9fcccc2d41995bedee3dcfc316d1e9.tar.gz
2008-09-01 Michael Snyder <msnyder@vmware.com>
* gdb.twreverse: New directory (may be renamed later). * gdb.twreverse/Makefile.in: New file. * gdb.twreverse/break-reverse.exp: New file. * gdb.twreverse/break-reverse.c: New file. * configure.in: Add gdb.twreverse directory. * configure: Regenerate.
-rw-r--r--gdb/testsuite/ChangeLog9
-rwxr-xr-xgdb/testsuite/configure41
-rw-r--r--gdb/testsuite/configure.ac2
-rw-r--r--gdb/testsuite/gdb.twreverse/Makefile.in16
-rw-r--r--gdb/testsuite/gdb.twreverse/break-reverse.c37
-rw-r--r--gdb/testsuite/gdb.twreverse/break-reverse.exp54
6 files changed, 147 insertions, 12 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index adcadd71431..206920b96ef 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+2008-09-01 Michael Snyder <msnyder@vmware.com>
+
+ * gdb.twreverse: New directory (may be renamed later).
+ * gdb.twreverse/Makefile.in: New file.
+ * gdb.twreverse/break-reverse.exp: New file.
+ * gdb.twreverse/break-reverse.c: New file.
+ * configure.in: Add gdb.twreverse directory.
+ * configure: Regenerate.
+
2008-07-17 Paul Pluzhnikov <ppluzhnikov@google.com>
* gdb.base/foll-fork.exp: Fix for Linux/VDSO failure.
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index 1a3e81371fa..92b418e29fc 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -314,6 +314,7 @@ ac_includes_default="\
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical subdirs RPATH_ENVVAR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBOBJS LTLIBOBJS'
ac_subst_files=''
+ac_pwd=`pwd`
# Initialize some variables set by options.
ac_init_help=
@@ -1281,6 +1282,8 @@ echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi
done
if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
echo "$as_me: error: changes in the environment can compromise the build" >&2;}
{ { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
@@ -1313,6 +1316,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -1850,11 +1856,13 @@ fi
fi
-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+test -z "$CC" && { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&5
echo "$as_me: error: no acceptable C compiler found in \$PATH
See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { (exit 1); exit 1; }; }; }
# Provide some information about the compiler.
echo "$as_me:$LINENO:" \
@@ -1940,11 +1948,13 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
See \`config.log' for more details." >&5
echo "$as_me: error: C compiler cannot create executables
See \`config.log' for more details." >&2;}
- { (exit 77); exit 77; }; }
+ { (exit 77); exit 77; }; }; }
fi
ac_exeext=$ac_cv_exeext
@@ -1969,13 +1979,15 @@ if test "$cross_compiling" != yes; then
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
- { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&5
echo "$as_me: error: cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { (exit 1); exit 1; }; }; }
fi
fi
fi
@@ -2013,11 +2025,13 @@ for ac_file in conftest.exe conftest conftest.*; do
esac
done
else
- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { (exit 1); exit 1; }; }; }
fi
rm -f conftest$ac_cv_exeext
@@ -2064,11 +2078,13 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+{ { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&5
echo "$as_me: error: cannot compute suffix of object files: cannot compile
See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { (exit 1); exit 1; }; }; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
@@ -2693,11 +2709,13 @@ rm -f conftest.err conftest.$ac_ext
if $ac_preproc_ok; then
:
else
- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+ { { echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&5
echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
+ { (exit 1); exit 1; }; }; }
fi
ac_ext=c
@@ -3113,7 +3131,7 @@ done
- ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+ ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.twreverse/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -3674,6 +3692,7 @@ do
"gdb.dwarf2/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.dwarf2/Makefile" ;;
"gdb.fortran/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.fortran/Makefile" ;;
"gdb.server/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.server/Makefile" ;;
+ "gdb.twreverse/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.twreverse/Makefile" ;;
"gdb.java/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.java/Makefile" ;;
"gdb.mi/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.mi/Makefile" ;;
"gdb.modula2/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.modula2/Makefile" ;;
diff --git a/gdb/testsuite/configure.ac b/gdb/testsuite/configure.ac
index 04d877325ba..5be1a55abb4 100644
--- a/gdb/testsuite/configure.ac
+++ b/gdb/testsuite/configure.ac
@@ -114,7 +114,7 @@ AC_OUTPUT([Makefile \
gdb.ada/Makefile \
gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile \
gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
- gdb.fortran/Makefile gdb.server/Makefile \
+ gdb.fortran/Makefile gdb.server/Makefile gdb.twreverse/Makefile \
gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile \
gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
diff --git a/gdb/testsuite/gdb.twreverse/Makefile.in b/gdb/testsuite/gdb.twreverse/Makefile.in
new file mode 100644
index 00000000000..7666dc8e8ea
--- /dev/null
+++ b/gdb/testsuite/gdb.twreverse/Makefile.in
@@ -0,0 +1,16 @@
+VPATH = @srcdir@
+srcdir = @srcdir@
+
+EXECUTABLES = break-reverse
+MISCELLANEOUS =
+
+all info install-info dvi install uninstall installcheck check:
+ @echo "Nothing to be done for $@..."
+
+clean mostlyclean:
+ rm -f *~ *.o *.x *.ci a.out core
+ rm -f $(EXECUTABLES) $(MISCELLANEOUS)
+
+distclean maintainer-clean realclean: clean
+ rm -f Makefile config.status config.log site.*
+
diff --git a/gdb/testsuite/gdb.twreverse/break-reverse.c b/gdb/testsuite/gdb.twreverse/break-reverse.c
new file mode 100644
index 00000000000..d58e2e5644d
--- /dev/null
+++ b/gdb/testsuite/gdb.twreverse/break-reverse.c
@@ -0,0 +1,37 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008 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/>. */
+
+int xyz;
+
+int bar ()
+{
+ xyz = 2; /* break in bar */
+ return 1;
+}
+
+int foo ()
+{
+ xyz = 1; /* break in foo */
+ return bar ();
+}
+
+int main ()
+{
+ xyz = 0; /* break in main */
+ foo ();
+ return (xyz == 2 ? 0 : 1);
+}
diff --git a/gdb/testsuite/gdb.twreverse/break-reverse.exp b/gdb/testsuite/gdb.twreverse/break-reverse.exp
new file mode 100644
index 00000000000..43db1cac06f
--- /dev/null
+++ b/gdb/testsuite/gdb.twreverse/break-reverse.exp
@@ -0,0 +1,54 @@
+# Copyright 2008 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 that 'set breakpoint always-inserted 1' is not a brick
+
+if { [prepare_for_testing break-reverse.exp break-reverse break-reverse.c] } {
+ return -1
+}
+
+global decimal
+
+set foo_location [gdb_get_line_number "break in foo" break-reverse.c]
+set bar_location [gdb_get_line_number "break in bar" break-reverse.c]
+set main_location [gdb_get_line_number "break in main" break-reverse.c]
+
+runto main
+
+gdb_test "break foo" \
+ "Breakpoint $decimal at .* line $foo_location\." \
+ "set breakpoint on foo"
+
+gdb_test "break bar" \
+ "Breakpoint $decimal at .* line $bar_location\." \
+ "set breakpoint on bar"
+
+# FIXME 'record' command should say something so we know it's working.
+gdb_test "record" "" "start recording"
+
+gdb_continue_to_breakpoint "foo" ".*/break-reverse.c:$foo_location.*"
+gdb_continue_to_breakpoint "bar" ".*/break-reverse.c:$bar_location.*"
+
+# FIXME 'set exec-dir' command should give some output so we can test.
+gdb_test "set exec-direction reverse" "" "set reverse"
+
+gdb_continue_to_breakpoint "foo" ".*/break-reverse.c:$foo_location.*"
+gdb_continue_to_breakpoint "main" ".*/break-reverse.c:$main_location.*"
+
+gdb_test "set exec-direction forward" "" "set forward"
+
+gdb_continue_to_breakpoint "foo" ".*/break-reverse.c:$foo_location.*"
+gdb_continue_to_breakpoint "bar" ".*/break-reverse.c:$bar_location.*"
+