ee681d3
Archer-upstreamed:
ee681d3
http://sourceware.org/ml/archer/2010-q2/msg00031.html
ee681d3
ee681d3
--- ./gdb/testsuite/gdb.cp/cxxexec.cc	1970-01-01 01:00:00.000000000 +0100
ee681d3
+++ ./gdb/testsuite/gdb.cp/cxxexec.cc	2010-05-29 01:18:56.000000000 +0200
ee681d3
@@ -0,0 +1,25 @@
ee681d3
+/* This test script is part of GDB, the GNU debugger.
ee681d3
+
ee681d3
+   Copyright 2010 Free Software Foundation, Inc.
ee681d3
+
ee681d3
+   This program is free software; you can redistribute it and/or modify
ee681d3
+   it under the terms of the GNU General Public License as published by
ee681d3
+   the Free Software Foundation; either version 3 of the License, or
ee681d3
+   (at your option) any later version.
ee681d3
+
ee681d3
+   This program is distributed in the hope that it will be useful,
ee681d3
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ee681d3
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ee681d3
+   GNU General Public License for more details.
ee681d3
+
ee681d3
+   You should have received a copy of the GNU General Public License
ee681d3
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
ee681d3
+
ee681d3
+#include <unistd.h>
ee681d3
+
ee681d3
+int
ee681d3
+main()
ee681d3
+{
ee681d3
+  execlp ("true", "true", NULL);
ee681d3
+  return 1;
ee681d3
+}
ee681d3
--- ./gdb/testsuite/gdb.cp/cxxexec.exp	1970-01-01 01:00:00.000000000 +0100
ee681d3
+++ ./gdb/testsuite/gdb.cp/cxxexec.exp	2010-05-29 01:29:25.000000000 +0200
ee681d3
@@ -0,0 +1,51 @@
ee681d3
+# Copyright 2010 Free Software Foundation, Inc.
ee681d3
+
ee681d3
+# This program is free software; you can redistribute it and/or modify
ee681d3
+# it under the terms of the GNU General Public License as published by
ee681d3
+# the Free Software Foundation; either version 3 of the License, or
ee681d3
+# (at your option) any later version.
ee681d3
+#
ee681d3
+# This program is distributed in the hope that it will be useful,
ee681d3
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
ee681d3
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
ee681d3
+# GNU General Public License for more details.
ee681d3
+#
ee681d3
+# You should have received a copy of the GNU General Public License
ee681d3
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
ee681d3
+
ee681d3
+if { [skip_cplus_tests] } { continue }
ee681d3
+
ee681d3
+set testfile cxxexec
ee681d3
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } {
ee681d3
+    return -1
ee681d3
+}
ee681d3
+
ee681d3
+runto_main
ee681d3
+
ee681d3
+# We could stop after `continue' again at `main'.
ee681d3
+delete_breakpoints
ee681d3
+
ee681d3
+set test "p _Unwind_DebugHook"
ee681d3
+gdb_test_multiple $test $test {
ee681d3
+    -re " = .* 0x\[0-9a-f\].*\r\n$gdb_prompt $" {
ee681d3
+	pass $test
ee681d3
+    }
ee681d3
+    -re "\r\nNo symbol .*\r\n$gdb_prompt $" {
ee681d3
+	xfail $test
ee681d3
+	untested ${testfile}.exp
ee681d3
+	return -1
ee681d3
+    }
ee681d3
+}
ee681d3
+
ee681d3
+set test continue
ee681d3
+gdb_test_multiple $test $test {
ee681d3
+    -re "Cannot access memory at address 0x\[0-9a-f\]+\r\n$gdb_prompt $" {
ee681d3
+	fail $test
ee681d3
+    }
ee681d3
+    -re "\r\n$gdb_prompt $" {
ee681d3
+	pass $test
ee681d3
+    }
ee681d3
+}
ee681d3
+
ee681d3
+# `info inferiors' can show <null> on older GDBs.
ee681d3
+gdb_test "info threads" "info threads" "program finished"