1 --- /dev/null 1 Jan 1970 00:00:00 -0000
2 +++ ./gdb/testsuite/gdb.base/attach-see-vdso.c 6 Jul 2007 14:14:44 -0000
4 +/* This testcase is part of GDB, the GNU debugger.
6 + Copyright 2007 Free Software Foundation, Inc.
8 + This program is free software; you can redistribute it and/or modify
9 + it under the terms of the GNU General Public License as published by
10 + the Free Software Foundation; either version 2 of the License, or
11 + (at your option) any later version.
13 + This program is distributed in the hope that it will be useful,
14 + but WITHOUT ANY WARRANTY; without even the implied warranty of
15 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 + GNU General Public License for more details.
18 + You should have received a copy of the GNU General Public License
19 + along with this program; if not, write to the Free Software
20 + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
29 --- /dev/null 1 Jan 1970 00:00:00 -0000
30 +++ ./gdb/testsuite/gdb.base/attach-see-vdso.exp 6 Jul 2007 14:14:44 -0000
34 +# This program is free software; you can redistribute it and/or modify
35 +# it under the terms of the GNU General Public License as published by
36 +# the Free Software Foundation; either version 2 of the License, or
37 +# (at your option) any later version.
39 +# This program is distributed in the hope that it will be useful,
40 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
41 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 +# GNU General Public License for more details.
44 +# You should have received a copy of the GNU General Public License
45 +# along with this program; if not, write to the Free Software
46 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
48 +# This file was created by Jan Kratochvil <jan.kratochvil@redhat.com>.
50 +# This test only works on Linux
51 +if { ![istarget "*-*-linux-gnu*"] } {
55 +set testfile "attach-see-vdso"
56 +set srcfile ${testfile}.c
57 +set binfile ${objdir}/${subdir}/${testfile}
58 +set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
60 +# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64).
62 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } {
63 + gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail."
66 +if [get_compiler_info ${binfile}] {
70 +# Start the program running and then wait for a bit, to be sure
71 +# that it can be attached to.
73 +set testpid [eval exec $binfile &]
78 +# Start with clean gdb
81 +gdb_reinitialize_dir $srcdir/$subdir
82 +# Never call: gdb_load ${binfile}
83 +# as the former problem would not reproduce otherwise.
86 +gdb_test_multiple "attach $testpid" "$test" {
87 + -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" {
92 +gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO"
94 +# Exit and detach the process.
98 +# Make sure we don't leave a process around to confuse
99 +# the next test run (and prevent the compile by keeping
100 +# the text file busy), in case the "set should_exit" didn't
103 +remote_exec build "kill -9 ${testpid}"