Blame SOURCES/gdb-6.5-bz218379-ppc-solib-trampoline-test.patch

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-6.5-bz218379-ppc-solib-trampoline-test.patch
a1b30c
a1b30c
;; Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
a1b30c
;;=fedoratest
a1b30c
a1b30c
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
a1b30c
a1b30c
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.c b/gdb/testsuite/gdb.base/step-over-trampoline.c
a1b30c
new file mode 100644
a1b30c
--- /dev/null
a1b30c
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.c
a1b30c
@@ -0,0 +1,28 @@
a1b30c
+/* This testcase is part of GDB, the GNU debugger.
a1b30c
+
a1b30c
+   Copyright 2006 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 2 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, write to the Free Software
a1b30c
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
a1b30c
+
a1b30c
+   Please email any bugs, comments, and/or additions to this file to:
a1b30c
+   bug-gdb@prep.ai.mit.edu  */
a1b30c
+
a1b30c
+#include <stdio.h>
a1b30c
+
a1b30c
+int main (void)
a1b30c
+{
a1b30c
+	puts ("hello world");
a1b30c
+	return 0;
a1b30c
+}
a1b30c
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.exp b/gdb/testsuite/gdb.base/step-over-trampoline.exp
a1b30c
new file mode 100644
a1b30c
--- /dev/null
a1b30c
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp
a1b30c
@@ -0,0 +1,59 @@
a1b30c
+# Copyright 2006 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 2 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, write to the Free Software
a1b30c
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
a1b30c
+
a1b30c
+if {[use_gdb_stub]} {
a1b30c
+    untested "skipping test because of use_gdb_stub"
a1b30c
+    return -1
a1b30c
+}
a1b30c
+
a1b30c
+if $tracelevel then {
a1b30c
+    strace $tracelevel
a1b30c
+}
a1b30c
+
a1b30c
+set testfile step-over-trampoline
a1b30c
+set srcfile ${testfile}.c
a1b30c
+set binfile [standard_output_file ${testfile}]
a1b30c
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
a1b30c
+    untested "Couldn't compile test program"
a1b30c
+    return -1
a1b30c
+}
a1b30c
+
a1b30c
+# Get things started.
a1b30c
+
a1b30c
+gdb_exit
a1b30c
+gdb_start
a1b30c
+gdb_reinitialize_dir $srcdir/$subdir
a1b30c
+gdb_load ${binfile}
a1b30c
+
a1b30c
+# For C programs, "start" should stop in main().
a1b30c
+
a1b30c
+gdb_test "start" \
a1b30c
+         "main \\(\\) at .*$srcfile.*" \
a1b30c
+         "start"
a1b30c
+
a1b30c
+# main () at hello2.c:5
a1b30c
+# 5		puts("hello world\n");
a1b30c
+# (gdb) next
a1b30c
+# 0x100007e0 in call___do_global_ctors_aux ()
a1b30c
+
a1b30c
+gdb_test_multiple "next" "invalid `next' output" {
a1b30c
+	-re "\nhello world.*return 0;.*" {
a1b30c
+		pass "stepped over"
a1b30c
+	}
a1b30c
+	-re " in call___do_global_ctors_aux \\(\\).*" {
a1b30c
+		fail "stepped into trampoline"
a1b30c
+	}
a1b30c
+}