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