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

190f2a
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
190f2a
From: Fedora GDB patches <invalid@email.com>
190f2a
Date: Fri, 27 Oct 2017 21:07:50 +0200
190f2a
Subject: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
190f2a
190f2a
;; Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
190f2a
;;=fedoratest
190f2a
190f2a
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
190f2a
190f2a
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.c b/gdb/testsuite/gdb.base/step-over-trampoline.c
190f2a
new file mode 100644
190f2a
--- /dev/null
190f2a
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.c
190f2a
@@ -0,0 +1,28 @@
190f2a
+/* This testcase is part of GDB, the GNU debugger.
190f2a
+
190f2a
+   Copyright 2006 Free Software Foundation, Inc.
190f2a
+
190f2a
+   This program is free software; you can redistribute it and/or modify
190f2a
+   it under the terms of the GNU General Public License as published by
190f2a
+   the Free Software Foundation; either version 2 of the License, or
190f2a
+   (at your option) any later version.
190f2a
+
190f2a
+   This program is distributed in the hope that it will be useful,
190f2a
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
190f2a
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
190f2a
+   GNU General Public License for more details.
190f2a
+ 
190f2a
+   You should have received a copy of the GNU General Public License
190f2a
+   along with this program; if not, write to the Free Software
190f2a
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
190f2a
+
190f2a
+   Please email any bugs, comments, and/or additions to this file to:
190f2a
+   bug-gdb@prep.ai.mit.edu  */
190f2a
+
190f2a
+#include <stdio.h>
190f2a
+
190f2a
+int main (void)
190f2a
+{
190f2a
+	puts ("hello world");
190f2a
+	return 0;
190f2a
+}
190f2a
diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.exp b/gdb/testsuite/gdb.base/step-over-trampoline.exp
190f2a
new file mode 100644
190f2a
--- /dev/null
190f2a
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp
190f2a
@@ -0,0 +1,54 @@
190f2a
+# Copyright 2006 Free Software Foundation, Inc.
190f2a
+
190f2a
+# This program is free software; you can redistribute it and/or modify
190f2a
+# it under the terms of the GNU General Public License as published by
190f2a
+# the Free Software Foundation; either version 2 of the License, or
190f2a
+# (at your option) any later version.
190f2a
+# 
190f2a
+# This program is distributed in the hope that it will be useful,
190f2a
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
190f2a
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
190f2a
+# GNU General Public License for more details.
190f2a
+# 
190f2a
+# You should have received a copy of the GNU General Public License
190f2a
+# along with this program; if not, write to the Free Software
190f2a
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  
190f2a
+
190f2a
+if $tracelevel then {
190f2a
+    strace $tracelevel
190f2a
+}
190f2a
+
190f2a
+set testfile step-over-trampoline
190f2a
+set srcfile ${testfile}.c
190f2a
+set binfile [standard_output_file ${testfile}]
190f2a
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
190f2a
+    untested "Couldn't compile test program"
190f2a
+    return -1
190f2a
+}
190f2a
+
190f2a
+# Get things started.
190f2a
+
190f2a
+gdb_exit
190f2a
+gdb_start
190f2a
+gdb_reinitialize_dir $srcdir/$subdir
190f2a
+gdb_load ${binfile}
190f2a
+
190f2a
+# For C programs, "start" should stop in main().
190f2a
+
190f2a
+gdb_test "start" \
190f2a
+         "main \\(\\) at .*$srcfile.*" \
190f2a
+         "start"
190f2a
+
190f2a
+# main () at hello2.c:5
190f2a
+# 5		puts("hello world\n");
190f2a
+# (gdb) next
190f2a
+# 0x100007e0 in call___do_global_ctors_aux ()
190f2a
+
190f2a
+gdb_test_multiple "next" "invalid `next' output" {
190f2a
+	-re "\nhello world.*return 0;.*" {
190f2a
+		pass "stepped over"
190f2a
+	}
190f2a
+	-re " in call___do_global_ctors_aux \\(\\).*" {
190f2a
+		fail "stepped into trampoline"
190f2a
+	}
190f2a
+}