Blame SOURCES/gdb-6.3-attach-see-vdso-test.patch

e1d87d
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.c
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.c	2016-02-15 23:25:36.749601045 +0100
e1d87d
@@ -0,0 +1,25 @@
e1d87d
+/* This testcase is part of GDB, the GNU debugger.
e1d87d
+
e1d87d
+   Copyright 2007 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+   This program is free software; you can redistribute it and/or modify
e1d87d
+   it under the terms of the GNU General Public License as published by
e1d87d
+   the Free Software Foundation; either version 2 of the License, or
e1d87d
+   (at your option) any later version.
e1d87d
+
e1d87d
+   This program is distributed in the hope that it will be useful,
e1d87d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+   GNU General Public License for more details.
e1d87d
+ 
e1d87d
+   You should have received a copy of the GNU General Public License
e1d87d
+   along with this program; if not, write to the Free Software
e1d87d
+   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
e1d87d
+
e1d87d
+#include <unistd.h>
e1d87d
+
e1d87d
+int main ()
e1d87d
+{
e1d87d
+  pause ();
e1d87d
+  return 1;
e1d87d
+}
e1d87d
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.exp
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/attach-see-vdso.exp	2016-02-15 23:25:44.889658840 +0100
e1d87d
@@ -0,0 +1,72 @@
e1d87d
+# Copyright 2007
e1d87d
+
e1d87d
+# This program is free software; you can redistribute it and/or modify
e1d87d
+# it under the terms of the GNU General Public License as published by
e1d87d
+# the Free Software Foundation; either version 2 of the License, or
e1d87d
+# (at your option) any later version.
e1d87d
+# 
e1d87d
+# This program is distributed in the hope that it will be useful,
e1d87d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+# GNU General Public License for more details.
e1d87d
+# 
e1d87d
+# You should have received a copy of the GNU General Public License
e1d87d
+# along with this program; if not, write to the Free Software
e1d87d
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
e1d87d
+
e1d87d
+# This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
e1d87d
+
e1d87d
+# This test only works on Linux
e1d87d
+if { ![istarget "*-*-linux-gnu*"] } {
e1d87d
+    return 0
e1d87d
+}
e1d87d
+
e1d87d
+set testfile "attach-see-vdso"
e1d87d
+set srcfile  ${testfile}.c
e1d87d
+set binfile  [standard_output_file ${testfile}]
e1d87d
+set escapedbinfile  [string_to_regexp [standard_output_file ${testfile}]]
e1d87d
+
e1d87d
+# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64).
e1d87d
+#
e1d87d
+if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } {
e1d87d
+    gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail."
e1d87d
+}
e1d87d
+
e1d87d
+if [get_compiler_info ${binfile}] {
e1d87d
+    return -1
e1d87d
+}
e1d87d
+
e1d87d
+# Start the program running and then wait for a bit, to be sure
e1d87d
+# that it can be attached to.
e1d87d
+
e1d87d
+set testpid [eval exec $binfile &]
e1d87d
+
e1d87d
+# Avoid some race:
e1d87d
+sleep 2
e1d87d
+
e1d87d
+# Start with clean gdb
e1d87d
+gdb_exit
e1d87d
+gdb_start
e1d87d
+gdb_reinitialize_dir $srcdir/$subdir
e1d87d
+# Never call: gdb_load ${binfile}
e1d87d
+# as the former problem would not reproduce otherwise.
e1d87d
+
e1d87d
+set test "attach"
e1d87d
+gdb_test_multiple "attach $testpid" "$test" {
e1d87d
+    -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" {
e1d87d
+	pass "$test"
e1d87d
+    }
e1d87d
+}
e1d87d
+
e1d87d
+gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO"
e1d87d
+
e1d87d
+# Exit and detach the process.
e1d87d
+   
e1d87d
+gdb_exit
e1d87d
+
e1d87d
+# Make sure we don't leave a process around to confuse
e1d87d
+# the next test run (and prevent the compile by keeping
e1d87d
+# the text file busy), in case the "set should_exit" didn't
e1d87d
+# work.
e1d87d
+   
e1d87d
+remote_exec build "kill -9 ${testpid}"