OLD | NEW |
1 # Copyright 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 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 | 15 |
16 load_lib mi-support.exp | 16 load_lib mi-support.exp |
17 set MIFLAGS "-i=mi" | 17 set MIFLAGS "-i=mi" |
18 | 18 |
19 if $tracelevel then { | |
20 strace $tracelevel | |
21 } | |
22 | |
23 # | 19 # |
24 # test running programs | 20 # test running programs |
25 # | 21 # |
26 | 22 |
27 if {[skip_shlib_tests]} { | 23 if {[skip_shlib_tests]} { |
28 return 0 | 24 return 0 |
29 } | 25 } |
30 | 26 |
31 set testfile "mi-pending" | 27 standard_testfile mi-pending.c mi-pendshr.c |
32 set libfile "mi-pendshr" | 28 set lib_sl [standard_output_file mi-pendshr.sl] |
33 set srcfile $testfile.c | |
34 set libsrc $srcdir/$subdir/$libfile.c | |
35 set binfile $objdir/$subdir/$testfile | |
36 set lib_sl $objdir/$subdir/$libfile.sl | |
37 | 29 |
38 set lib_opts debug | 30 set lib_opts debug |
39 set exec_opts [list debug shlib=$lib_sl] | 31 set exec_opts [list debug shlib=$lib_sl] |
40 | 32 |
41 if [get_compiler_info ${binfile}] { | 33 if [get_compiler_info] { |
42 return -1 | 34 return -1 |
43 } | 35 } |
44 | 36 |
45 if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != "" | 37 if { [gdb_compile_shlib $srcdir/$subdir/$srcfile2 $lib_sl $lib_opts] != "" |
46 || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] !=
""} { | 38 || [gdb_compile $srcdir/$subdir/$srcfile $binfile executable $exec_opts] !=
""} { |
47 untested "Could not compile either $libsrc or $srcdir/$subdir/$srcfile." | 39 untested "Could not compile either $libsrc or $srcdir/$subdir/$srcfile." |
48 return -1 | 40 return -1 |
49 } | 41 } |
50 | 42 |
51 # Start with a fresh gdb. | 43 # Start with a fresh gdb. |
52 | 44 |
53 gdb_exit | 45 gdb_exit |
54 mi_gdb_start | 46 mi_gdb_start |
55 mi_gdb_reinitialize_dir $srcdir/$subdir | 47 mi_gdb_reinitialize_dir $srcdir/$subdir |
56 mi_gdb_load ${binfile} | 48 mi_gdb_load ${binfile} |
57 mi_load_shlibs $lib_sl | 49 mi_load_shlibs $lib_sl |
58 | 50 |
59 if [target_info exists gdb_stub] { | |
60 gdb_step_for_stub; | |
61 } | |
62 | |
63 # Set pending breakpoint via MI | 51 # Set pending breakpoint via MI |
64 mi_gdb_test "-break-insert -f pendfunc1" \ | 52 mi_gdb_test "-break-insert -f pendfunc1" \ |
65 ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y
\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\",original-location=\"pend
func1\"\}"\ | 53 ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y
\",addr=\"<PENDING>\",pending=\"pendfunc1\",times=\"0\",original-location=\"pend
func1\"\}"\ |
66 "MI pending breakpoint on pendfunc1" | 54 "MI pending breakpoint on pendfunc1" |
67 | 55 |
68 mi_run_cmd | 56 mi_run_cmd |
69 mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \ | 57 mi_expect_stop "breakpoint-hit" "pendfunc1" ".*" ".*" ".*" \ |
70 { "" "disp=\"keep\"" } \ | 58 { "" "disp=\"keep\"" } \ |
71 "Run till MI pending breakpoint on pendfunc1" | 59 "Run till MI pending breakpoint on pendfunc1" |
OLD | NEW |