OLD | NEW |
1 # Copyright 2005, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 2005, 2007-2012 Free Software Foundation, Inc. |
2 | 2 |
3 # This program is free software; you can redistribute it and/or modify | 3 # This program is free software; you can redistribute it and/or modify |
4 # it under the terms of the GNU General Public License as published by | 4 # it under the terms of the GNU General Public License as published by |
5 # the Free Software Foundation; either version 3 of the License, or | 5 # the Free Software Foundation; either version 3 of the License, or |
6 # (at your option) any later version. | 6 # (at your option) any later version. |
7 # | 7 # |
8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 load_lib dwarf.exp | 15 load_lib dwarf.exp |
16 | 16 |
17 # Check that GDB can gracefully handle macro information that has | 17 # Check that GDB can gracefully handle macro information that has |
18 # bogus file numbers. | 18 # bogus file numbers. |
19 | 19 |
20 # This test can only be run on targets which support DWARF-2 and use gas. | 20 # This test can only be run on targets which support DWARF-2 and use gas. |
21 if {![dwarf2_support]} { | 21 if {![dwarf2_support]} { |
22 return 0 | 22 return 0 |
23 } | 23 } |
24 | 24 |
25 set testfile "mac-fileno" | 25 standard_testfile .S |
26 set dwarf_srcfile "file1.txt" | 26 set dwarf_srcfile "file1.txt" |
27 set srcfile ${testfile}.S | |
28 set binfile ${objdir}/${subdir}/${testfile}.x | |
29 | 27 |
30 if { [gdb_compile "${srcdir}/${subdir}/main.c" "main.o" object {debug}] != "" }
{ | 28 if {[prepare_for_testing_full $testfile.exp \ |
| 29 » [list $testfile debug main.c debug $srcfile nodebug]]} { |
31 return -1 | 30 return -1 |
32 } | 31 } |
33 | 32 |
34 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${testfile}.o" object {node
bug}] != "" } { | |
35 return -1 | |
36 } | |
37 | |
38 if { [gdb_compile "${testfile}.o main.o" "${binfile}" executable {debug}] != ""
} { | |
39 return -1 | |
40 } | |
41 | |
42 gdb_exit | |
43 gdb_start | |
44 gdb_reinitialize_dir $srcdir/$subdir | |
45 gdb_load ${binfile} | |
46 | |
47 set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfi
le}] | 33 set remote_dwarf_srcfile [remote_download host ${srcdir}/${subdir}/${dwarf_srcfi
le}] |
48 | 34 |
49 gdb_test_no_output "set listsize 1" | 35 gdb_test_no_output "set listsize 1" |
50 gdb_test "list func_cu1" "4\[ \t\]+File 1 Line 4" | 36 gdb_test "list func_cu1" "4\[ \t\]+File 1 Line 4" |
51 gdb_test "ptype func_cu1" "type = int \\(\\)" | 37 gdb_test "ptype func_cu1" "type = int \\(\\)" |
52 | 38 |
53 remote_file host delete ${remote_dwarf_srcfile} | 39 remote_file host delete ${remote_dwarf_srcfile} |
OLD | NEW |