OLD | NEW |
1 # Copyright 2011-2012 Free Software Foundation, Inc. | 1 # Copyright 2011-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 # The same tests as in jit.exp, but loading JITer itself from a shared | 16 # The same tests as in jit.exp, but loading JITer itself from a shared |
17 # library. | 17 # library. |
18 | 18 |
19 if $tracelevel { | |
20 strace $tracelevel | |
21 } | |
22 | |
23 if {[skip_shlib_tests]} { | 19 if {[skip_shlib_tests]} { |
24 untested jit-so.exp | 20 untested jit-so.exp |
25 return -1 | 21 return -1 |
26 } | 22 } |
27 | 23 |
28 if {[get_compiler_info not-used]} { | 24 if {[get_compiler_info]} { |
29 warning "Could not get compiler info" | 25 warning "Could not get compiler info" |
30 untested jit-so.exp | 26 untested jit-so.exp |
31 return 1 | 27 return 1 |
32 } | 28 } |
33 | 29 |
34 # | 30 # |
35 # test running programs | 31 # test running programs |
36 # | 32 # |
37 | 33 |
38 set testfile jit-dlmain | 34 set testfile jit-dlmain |
(...skipping 21 matching lines...) Expand all Loading... |
60 # Note: compiling without debug info: the library goes through symbol | 56 # Note: compiling without debug info: the library goes through symbol |
61 # renaming by munging on its symbol table, and that wouldn't work for .debug | 57 # renaming by munging on its symbol table, and that wouldn't work for .debug |
62 # sections. Also, output for "info function" changes when debug info is resent. | 58 # sections. Also, output for "info function" changes when debug info is resent. |
63 if { [gdb_compile_shlib ${solib_srcfile} ${solib_binfile} {}] != "" } { | 59 if { [gdb_compile_shlib ${solib_srcfile} ${solib_binfile} {}] != "" } { |
64 untested jit-so.exp | 60 untested jit-so.exp |
65 return -1 | 61 return -1 |
66 } | 62 } |
67 | 63 |
68 set solib_binfile_target [gdb_download ${solib_binfile}] | 64 set solib_binfile_target [gdb_download ${solib_binfile}] |
69 | 65 |
70 proc one_jit_test {count match_str} { | 66 proc one_jit_test {count match_str} { with_test_prefix "one_jit_test-$count" { |
71 global verbose testfile srcfile2 binfile2 binfile2_dlopen solib_binfile_targ
et solib_binfile_test_msg pf_prefix | 67 global verbose testfile srcfile2 binfile2 binfile2_dlopen solib_binfile_targ
et solib_binfile_test_msg |
72 | |
73 set old_pf_prefix $pf_prefix | |
74 lappend pf_prefix "one_jit_test-$count:" | |
75 | 68 |
76 clean_restart $testfile | 69 clean_restart $testfile |
77 gdb_load_shlibs $binfile2 | 70 gdb_load_shlibs $binfile2 |
78 | 71 |
79 # This is just to help debugging when things fail | 72 # This is just to help debugging when things fail |
80 if {$verbose > 0} { | 73 if {$verbose > 0} { |
81 gdb_test "set debug jit 1" | 74 gdb_test "set debug jit 1" |
82 } | 75 } |
83 | 76 |
84 if { ![runto_main] } { | 77 if { ![runto_main] } { |
(...skipping 26 matching lines...) Expand all Loading... |
111 if {$verbose > 0} { | 104 if {$verbose > 0} { |
112 gdb_test "maintenance print objfiles" | 105 gdb_test "maintenance print objfiles" |
113 gdb_test "maintenance info break" | 106 gdb_test "maintenance info break" |
114 } | 107 } |
115 | 108 |
116 gdb_breakpoint "$srcfile2:[gdb_get_line_number {break here 2} $srcfile2]" | 109 gdb_breakpoint "$srcfile2:[gdb_get_line_number {break here 2} $srcfile2]" |
117 gdb_continue_to_breakpoint "break here 2" | 110 gdb_continue_to_breakpoint "break here 2" |
118 # All jit librares must have been unregistered | 111 # All jit librares must have been unregistered |
119 gdb_test "info function jit_function" \ | 112 gdb_test "info function jit_function" \ |
120 "All functions matching regular expression \"jit_function\":" | 113 "All functions matching regular expression \"jit_function\":" |
121 set pf_prefix $old_pf_prefix | 114 }} |
122 } | |
123 | 115 |
124 one_jit_test 1 "${hex} jit_function_0000" | 116 one_jit_test 1 "${hex} jit_function_0000" |
125 one_jit_test 2 "${hex} jit_function_0000\[\r\n\]+${hex} jit_function_0001" | 117 one_jit_test 2 "${hex} jit_function_0000\[\r\n\]+${hex} jit_function_0001" |
OLD | NEW |