OLD | NEW |
1 # Copyright 2008, 2010-2012 Free Software Foundation, Inc. | 1 # Copyright 2008, 2010-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 | 15 |
16 set testfile "inline-cmds" | 16 standard_testfile .c inline-markers.c |
17 set srcfile "${testfile}.c" | |
18 set srcfile2 "inline-markers.c" | |
19 set fullsrcfile "${srcdir}/${subdir}/${srcfile}" | |
20 set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}" | |
21 set sources [list ${fullsrcfile} ${fullsrcfile2}] | |
22 set binfile ${objdir}/${subdir}/${testfile} | |
23 | 17 |
24 if { [gdb_compile $sources ${binfile} \ | 18 if {[prepare_for_testing $testfile.exp $testfile \ |
25 » executable {debug optimize=-O2}] != "" } { | 19 » [list $srcfile $srcfile2] {debug optimize=-O2}]} { |
26 untested inline-cmds.exp | |
27 return -1 | 20 return -1 |
28 } | 21 } |
29 | 22 |
30 gdb_exit | |
31 gdb_start | |
32 gdb_reinitialize_dir $srcdir/$subdir | |
33 gdb_load ${binfile} | |
34 | |
35 gdb_test_no_output "set listsize 1" | 23 gdb_test_no_output "set listsize 1" |
36 | 24 |
37 runto_main | 25 runto_main |
38 | 26 |
39 get_compiler_info $binfile | 27 get_compiler_info |
40 get_debug_format | 28 get_debug_format |
41 if { [skip_inline_frame_tests] } { | 29 if { [skip_inline_frame_tests] } { |
42 untested inline-cmds.exp | 30 untested inline-cmds.exp |
43 return | 31 return |
44 } | 32 } |
45 | 33 |
46 # First, check that the things we expected to be inlined really were, | 34 # First, check that the things we expected to be inlined really were, |
47 # and those that shouldn't be weren't. | 35 # and those that shouldn't be weren't. |
48 set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}] | 36 set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}] |
49 gdb_breakpoint $srcfile2:$line1 | 37 gdb_breakpoint $srcfile2:$line1 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 gdb_test "bt" "#0 inlined_fn.*#1 noinline.*#2 .*outer_inline1.*#3 .*outer_in
line2.*#4 main.*" "backtrace at inlined_fn from noinline" | 308 gdb_test "bt" "#0 inlined_fn.*#1 noinline.*#2 .*outer_inline1.*#3 .*outer_in
line2.*#4 main.*" "backtrace at inlined_fn from noinline" |
321 gdb_test "info frame" ".*inlined into frame.*" "inlined_fn from noinline inlined
" | 309 gdb_test "info frame" ".*inlined into frame.*" "inlined_fn from noinline inlined
" |
322 gdb_test "up" "#1 noinline.*" "up to noinline" | 310 gdb_test "up" "#1 noinline.*" "up to noinline" |
323 gdb_test "info frame" ".*\n called by frame.*" "noinline from outer_inline1 not
inlined" | 311 gdb_test "info frame" ".*\n called by frame.*" "noinline from outer_inline1 not
inlined" |
324 gdb_test "up" "#2 .*outer_inline1.*" "up to outer_inline1" | 312 gdb_test "up" "#2 .*outer_inline1.*" "up to outer_inline1" |
325 gdb_test "info frame" ".*inlined into frame.*" "outer_inline1 inlined" | 313 gdb_test "info frame" ".*inlined into frame.*" "outer_inline1 inlined" |
326 gdb_test "up" "#3 .*outer_inline2.*" "up to outer_inline2" | 314 gdb_test "up" "#3 .*outer_inline2.*" "up to outer_inline2" |
327 gdb_test "info frame" ".*inlined into frame.*" "outer_inline2 inlined" | 315 gdb_test "info frame" ".*inlined into frame.*" "outer_inline2 inlined" |
328 gdb_test "up" "#4 main.*" "up from outer_inline2" | 316 gdb_test "up" "#4 main.*" "up from outer_inline2" |
329 gdb_test "info frame" ".*\n caller of frame.*" "main not inlined" | 317 gdb_test "info frame" ".*\n caller of frame.*" "main not inlined" |
OLD | NEW |