OLD | NEW |
1 # Copyright (C) 2011-2012 Free Software Foundation, Inc. | 1 # Copyright (C) 2011-2013 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 | 15 |
16 set testfile dmsym_main | 16 set testfile dmsym_main |
17 | 17 |
18 # Build dmsym_main using two C files: | 18 # Build dmsym_main using two C files: |
19 # - dmsym.c, which needs to be built without debug info; | 19 # - dmsym.c, which needs to be built without debug info; |
20 # - dmsym_main.c, which needs to be build with debug info. | 20 # - dmsym_main.c, which needs to be build with debug info. |
21 # This is why we use gdb_compile instead of relying on the usual | 21 # This is why we use gdb_compile instead of relying on the usual |
22 # call to prepare_for_testing. | 22 # call to prepare_for_testing. |
23 | 23 |
| 24 set dmsym_o [standard_output_file dmsym.o] |
| 25 |
24 if {[gdb_compile "${srcdir}/${subdir}/dmsym.c" \ | 26 if {[gdb_compile "${srcdir}/${subdir}/dmsym.c" \ |
25 ${objdir}/${subdir}/dmsym.o \ | 27 $dmsym_o \ |
26 object {}] != ""} { | 28 object {}] != ""} { |
27 untested dmsym.exp | 29 untested dmsym.exp |
28 return -1 | 30 return -1 |
29 } | 31 } |
30 | 32 |
31 if {[gdb_compile \ | 33 if {[gdb_compile \ |
32 [list ${srcdir}/${subdir}/dmsym_main.c ${objdir}/${subdir}/dmsym.o] \ | 34 [list ${srcdir}/${subdir}/dmsym_main.c $dmsym_o] \ |
33 ${objdir}/${subdir}/${testfile} \ | 35 [standard_output_file ${testfile}] \ |
34 executable {debug}] != ""} { | 36 executable {debug}] != ""} { |
35 untested dmsym.exp | 37 untested dmsym.exp |
36 return -1 | 38 return -1 |
37 } | 39 } |
38 | 40 |
39 clean_restart ${testfile} | 41 clean_restart ${testfile} |
40 | 42 |
41 # Some convenient regular expressions... | 43 # Some convenient regular expressions... |
42 set num "\[0-9\]+" | 44 set num "\[0-9\]+" |
43 set addr "0x\[0-9a-zA-Z\]+" | 45 set addr "0x\[0-9a-zA-Z\]+" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 gdb_run_cmd | 80 gdb_run_cmd |
79 gdb_test "" \ | 81 gdb_test "" \ |
80 "Breakpoint $num, pck__foo__bar__minsym__2 \\(\\) at.*" \ | 82 "Breakpoint $num, pck__foo__bar__minsym__2 \\(\\) at.*" \ |
81 "Run until breakpoint at BREAK" | 83 "Run until breakpoint at BREAK" |
82 | 84 |
83 gdb_test "continue" \ | 85 gdb_test "continue" \ |
84 "Breakpoint $num, main \\(\\) at.*" | 86 "Breakpoint $num, main \\(\\) at.*" |
85 | 87 |
86 gdb_test "print val" \ | 88 gdb_test "print val" \ |
87 " = 124" | 89 " = 124" |
OLD | NEW |