Blame SOURCES/gdb-archer-next-over-throw-cxx-exec.patch

93189d
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
93189d
From: Fedora GDB patches <invalid@email.com>
93189d
Date: Fri, 27 Oct 2017 21:07:50 +0200
93189d
Subject: gdb-archer-next-over-throw-cxx-exec.patch
93189d
93189d
;; Fix follow-exec for C++ programs (bugreported by Martin Stransky).
93189d
;;=fedoratest
93189d
93189d
Archer-upstreamed:
93189d
http://sourceware.org/ml/archer/2010-q2/msg00031.html
93189d
93189d
diff --git a/gdb/testsuite/gdb.cp/cxxexec.cc b/gdb/testsuite/gdb.cp/cxxexec.cc
93189d
new file mode 100644
93189d
--- /dev/null
93189d
+++ b/gdb/testsuite/gdb.cp/cxxexec.cc
93189d
@@ -0,0 +1,25 @@
93189d
+/* This test script is part of GDB, the GNU debugger.
93189d
+
93189d
+   Copyright 2010 Free Software Foundation, Inc.
93189d
+
93189d
+   This program is free software; you can redistribute it and/or modify
93189d
+   it under the terms of the GNU General Public License as published by
93189d
+   the Free Software Foundation; either version 3 of the License, or
93189d
+   (at your option) any later version.
93189d
+
93189d
+   This program is distributed in the hope that it will be useful,
93189d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
93189d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
93189d
+   GNU General Public License for more details.
93189d
+
93189d
+   You should have received a copy of the GNU General Public License
93189d
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
93189d
+
93189d
+#include <unistd.h>
93189d
+
93189d
+int
93189d
+main()
93189d
+{
93189d
+  execlp ("true", "true", NULL);
93189d
+  return 1;
93189d
+}
93189d
diff --git a/gdb/testsuite/gdb.cp/cxxexec.exp b/gdb/testsuite/gdb.cp/cxxexec.exp
93189d
new file mode 100644
93189d
--- /dev/null
93189d
+++ b/gdb/testsuite/gdb.cp/cxxexec.exp
93189d
@@ -0,0 +1,42 @@
93189d
+# Copyright 2010 Free Software Foundation, Inc.
93189d
+
93189d
+# This program is free software; you can redistribute it and/or modify
93189d
+# it under the terms of the GNU General Public License as published by
93189d
+# the Free Software Foundation; either version 3 of the License, or
93189d
+# (at your option) any later version.
93189d
+#
93189d
+# This program is distributed in the hope that it will be useful,
93189d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
93189d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
93189d
+# GNU General Public License for more details.
93189d
+#
93189d
+# You should have received a copy of the GNU General Public License
93189d
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
93189d
+
93189d
+if { [skip_cplus_tests] } { continue }
93189d
+
93189d
+set testfile cxxexec
93189d
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } {
93189d
+    return -1
93189d
+}
93189d
+
93189d
+runto_main
93189d
+
93189d
+# We could stop after `continue' again at `main'.
93189d
+delete_breakpoints
93189d
+
93189d
+set test "p _Unwind_DebugHook"
93189d
+gdb_test_multiple $test $test {
93189d
+    -re " = .* 0x\[0-9a-f\].*\r\n$gdb_prompt $" {
93189d
+	pass $test
93189d
+    }
93189d
+    -re "\r\nNo symbol .*\r\n$gdb_prompt $" {
93189d
+	xfail $test
93189d
+	untested ${testfile}.exp
93189d
+	return -1
93189d
+    }
93189d
+}
93189d
+
93189d
+# Run to end.  The buggy GDB failed instead with:
93189d
+#  Cannot access memory at address ADDR.
93189d
+gdb_continue_to_end "" "continue" 1