418be79
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
418be79
418be79
Jan Kratochvil 22d1e60
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/step-over-trampoline.exp
Jan Kratochvil 22d1e60
===================================================================
Jan Kratochvil 22d1e60
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 22d1e60
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/step-over-trampoline.exp	2016-02-15 23:31:47.312232078 +0100
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
+}
Jan Kratochvil 22d1e60
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/step-over-trampoline.c
Jan Kratochvil 22d1e60
===================================================================
Jan Kratochvil 22d1e60
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
Jan Kratochvil 22d1e60
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/step-over-trampoline.c	2016-02-15 23:30:54.698858518 +0100
418be79
@@ -0,0 +1,28 @@
418be79
+/* This testcase is part of GDB, the GNU debugger.
418be79
+
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
+   Please email any bugs, comments, and/or additions to this file to:
418be79
+   bug-gdb@prep.ai.mit.edu  */
418be79
+
418be79
+#include <stdio.h>
418be79
+
418be79
+int main (void)
418be79
+{
418be79
+	puts ("hello world");
418be79
+	return 0;
418be79
+}