OLD | NEW |
1 # Test `info auxv' and related functionality. | 1 # Test `info auxv' and related functionality. |
2 | 2 |
3 # Copyright (C) 1992-2000, 2004, 2007-2010, 2012 Free Software | 3 # Copyright (C) 1992-2000, 2004, 2007-2010, 2012 Free Software |
4 # Foundation, Inc. | 4 # Foundation, Inc. |
5 | 5 |
6 # This program is free software; you can redistribute it and/or modify | 6 # This program is free software; you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License as published by | 7 # it under the terms of the GNU General Public License as published by |
8 # the Free Software Foundation; either version 3 of the License, or | 8 # the Free Software Foundation; either version 3 of the License, or |
9 # (at your option) any later version. | 9 # (at your option) any later version. |
10 # | 10 # |
11 # This program is distributed in the hope that it will be useful, | 11 # This program is distributed in the hope that it will be useful, |
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 # GNU General Public License for more details. | 14 # GNU General Public License for more details. |
15 # | 15 # |
16 # You should have received a copy of the GNU General Public License | 16 # You should have received a copy of the GNU General Public License |
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 17 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | 18 |
19 # This file is based on corefile.exp which was written by Fred | 19 # This file is based on corefile.exp which was written by Fred |
20 # Fish. (fnf@cygnus.com) | 20 # Fish. (fnf@cygnus.com) |
21 | 21 |
22 if { ! [istarget "*-*-linux*"] && ! [istarget "*-*-solaris*"] } { | 22 if { ! [istarget "*-*-linux*"] && ! [istarget "*-*-solaris*"] } { |
23 verbose "Skipping auxv.exp because of lack of support." | 23 verbose "Skipping auxv.exp because of lack of support." |
24 return | 24 return |
25 } | 25 } |
26 | 26 |
27 if $tracelevel then { | |
28 strace $tracelevel | |
29 } | |
30 | |
31 | 27 |
32 set testfile "auxv" | 28 set testfile "auxv" |
33 set srcfile ${testfile}.c | 29 set srcfile ${testfile}.c |
34 set binfile ${objdir}/${subdir}/${testfile} | 30 set binfile ${objdir}/${subdir}/${testfile} |
35 set corefile ${objdir}/${subdir}/${testfile}.corefile | 31 set corefile ${objdir}/${subdir}/${testfile}.corefile |
36 set gcorefile ${objdir}/${subdir}/${testfile}.gcore | 32 set gcorefile ${objdir}/${subdir}/${testfile}.gcore |
37 | 33 |
38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug}] != "" } { | 34 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ |
| 35 » » {debug additional_flags=-DUSE_RLIMIT}] != "" |
| 36 && [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ |
| 37 » » {debug}] != "" } { |
39 untested "couldn't compile ${srcdir}/${subdir}/${srcfile}" | 38 untested "couldn't compile ${srcdir}/${subdir}/${srcfile}" |
40 return -1 | 39 return -1 |
41 } | 40 } |
42 | 41 |
43 # Use a fresh directory to confine the native core dumps. | 42 # Use a fresh directory to confine the native core dumps. |
44 # Make it the working directory for gdb and its child. | 43 # Make it the working directory for gdb and its child. |
45 set coredir "${objdir}/${subdir}/coredir.[getpid]" | 44 set coredir "${objdir}/${subdir}/coredir.[getpid]" |
46 file mkdir $coredir | 45 file mkdir $coredir |
47 set core_works [expr [isnative] && ! [is_remote target]] | 46 set core_works [expr [isnative] && ! [is_remote target]] |
48 | 47 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 if {$core_works} { | 151 if {$core_works} { |
153 # Find the | 152 # Find the |
154 set names [glob -nocomplain -directory $coredir *core*] | 153 set names [glob -nocomplain -directory $coredir *core*] |
155 if {[llength $names] == 1} { | 154 if {[llength $names] == 1} { |
156 set file [file join $coredir [lindex $names 0]] | 155 set file [file join $coredir [lindex $names 0]] |
157 remote_exec build "mv $file $corefile" | 156 remote_exec build "mv $file $corefile" |
158 pass $test | 157 pass $test |
159 } else { | 158 } else { |
160 set core_works 0 | 159 set core_works 0 |
161 warning "can't generate a core file - core tests suppressed - check ulim
it -c" | 160 warning "can't generate a core file - core tests suppressed - check ulim
it -c" |
162 » fail $test | 161 » unsupported $test |
163 } | 162 } |
164 } else { | 163 } else { |
165 unsupported $test | 164 unsupported $test |
166 } | 165 } |
167 remote_exec build "rm -rf $coredir" | 166 remote_exec build "rm -rf $coredir" |
168 | 167 |
169 # Now we can examine the core files and check that their data matches what | 168 # Now we can examine the core files and check that their data matches what |
170 # we saw in the process. Note that the exact data can vary between runs, | 169 # we saw in the process. Note that the exact data can vary between runs, |
171 # so it's important that the native core dump file and the gcore-created dump | 170 # so it's important that the native core dump file and the gcore-created dump |
172 # both be from the same run of the program as we examined live. | 171 # both be from the same run of the program as we examined live. |
(...skipping 14 matching lines...) Expand all Loading... |
187 fail $test2 | 186 fail $test2 |
188 } | 187 } |
189 } | 188 } |
190 } | 189 } |
191 | 190 |
192 do_core_test $core_works $corefile \ | 191 do_core_test $core_works $corefile \ |
193 "info auxv on native core dump" "matching auxv data from live and core" | 192 "info auxv on native core dump" "matching auxv data from live and core" |
194 | 193 |
195 do_core_test $gcore_works $gcorefile \ | 194 do_core_test $gcore_works $gcorefile \ |
196 "info auxv on gcore-created dump" "matching auxv data from live and gcore" | 195 "info auxv on gcore-created dump" "matching auxv data from live and gcore" |
OLD | NEW |