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 +if $tracelevel then {
57 +# This test only works on Linux
58 +if { ![istarget "*-*-linux-gnu*"] } {
62 +set testfile "attach-see-vdso"
63 +set srcfile ${testfile}.c
64 +set binfile ${objdir}/${subdir}/${testfile}
65 +set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}]
67 +# The kernel VDSO is used for the syscalls returns only on i386 (not x86_64).
69 +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-m32}] != "" } {
70 + gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail."
73 +if [get_compiler_info ${binfile}] {
77 +# Start the program running and then wait for a bit, to be sure
78 +# that it can be attached to.
80 +set testpid [eval exec $binfile &]
85 +# Start with clean gdb
88 +gdb_reinitialize_dir $srcdir/$subdir
89 +# Never call: gdb_load ${binfile}
90 +# as the former problem would not reproduce otherwise.
93 +gdb_test_multiple "attach $testpid" "$test" {
94 + -re "Attaching to process $testpid\r?\n.*$gdb_prompt $" {
99 +gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO"
101 +# Exit and detach the process.
105 +# Make sure we don't leave a process around to confuse
106 +# the next test run (and prevent the compile by keeping
107 +# the text file busy), in case the "set should_exit" didn't
110 +remote_exec build "kill -9 ${testpid}"