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