OLD | NEW |
1 # Copyright 1988, 1990-1992, 1994, 1997, 1999-2000, 2002-2012 Free | 1 # Copyright 1988, 1990-1992, 1994, 1997, 1999-2000, 2002-2012 Free |
2 # Software Foundation, Inc. | 2 # Software Foundation, Inc. |
3 | 3 |
4 # This program is free software; you can redistribute it and/or modify | 4 # This program is free software; you can redistribute it and/or modify |
5 # it under the terms of the GNU General Public License as published by | 5 # it under the terms of the GNU General Public License as published by |
6 # the Free Software Foundation; either version 3 of the License, or | 6 # the Free Software Foundation; either version 3 of the License, or |
7 # (at your option) any later version. | 7 # (at your option) any later version. |
8 # | 8 # |
9 # This program is distributed in the hope that it will be useful, | 9 # This program is distributed in the hope that it will be useful, |
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 # GNU General Public License for more details. | 12 # GNU General Public License for more details. |
13 # | 13 # |
14 # You should have received a copy of the GNU General Public License | 14 # You should have received a copy of the GNU General Public License |
15 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 |
17 # This file was written by Rob Savoye. (rob@cygnus.com) | 17 # This file was written by Rob Savoye. (rob@cygnus.com) |
18 | 18 |
19 if $tracelevel then { | |
20 strace $tracelevel | |
21 } | |
22 | |
23 | 19 |
24 # are we on a target board | 20 # are we on a target board |
25 if { [is_remote target] || ![isnative] } then { | 21 if { [is_remote target] || ![isnative] } then { |
26 return | 22 return |
27 } | 23 } |
28 | 24 |
29 # Not all of the lines of code near the start of main are executed for | 25 # Not all of the lines of code near the start of main are executed for |
30 # every machine. Also, optimization may reorder some of the lines. | 26 # every machine. Also, optimization may reorder some of the lines. |
31 # So all we do is try to step or next over everything until we get | 27 # So all we do is try to step or next over everything until we get |
32 # to a line that we know is always executed. | 28 # to a line that we know is always executed. |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 set command "step" | 81 set command "step" |
86 } | 82 } |
87 -re ".*cdarg = NULL.*$gdb_prompt $" { | 83 -re ".*cdarg = NULL.*$gdb_prompt $" { |
88 set description "step over cdarg initialization" | 84 set description "step over cdarg initialization" |
89 set command "step" | 85 set command "step" |
90 } | 86 } |
91 -re ".*ttyarg = NULL.*$gdb_prompt $" { | 87 -re ".*ttyarg = NULL.*$gdb_prompt $" { |
92 set description "step over ttyarg initialization" | 88 set description "step over ttyarg initialization" |
93 set command "step" | 89 set command "step" |
94 } | 90 } |
| 91 -re ".*cmdarg_vec = NULL.*$gdb_prompt $" { |
| 92 set description "step over cmdarg_vec initialization" |
| 93 set command "step" |
| 94 } |
95 -re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" { | 95 -re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" { |
96 set description "next over make_command_stats_cleanup and everyt
hing it calls" | 96 set description "next over make_command_stats_cleanup and everyt
hing it calls" |
97 set command "next" | 97 set command "next" |
98 } | 98 } |
99 -re ".*START_PROGRESS.*$gdb_prompt $" { | 99 -re ".*START_PROGRESS.*$gdb_prompt $" { |
100 # Note: ezannoni/2004/02/17: This check should be | 100 # Note: ezannoni/2004/02/17: This check should be |
101 # removed, since as of today that source line is not | 101 # removed, since as of today that source line is not |
102 # in gdb anymore. | 102 # in gdb anymore. |
103 set description "next over START_PROGRESS and everything it call
s" | 103 set description "next over START_PROGRESS and everything it call
s" |
104 set command "next" | 104 set command "next" |
(...skipping 16 matching lines...) Expand all Loading... |
121 set command "next" | 121 set command "next" |
122 } | 122 } |
123 -re ".*if .i != 0.*$gdb_prompt $" { | 123 -re ".*if .i != 0.*$gdb_prompt $" { |
124 set description "next over conditional stack alignment code 2" | 124 set description "next over conditional stack alignment code 2" |
125 set command "next" | 125 set command "next" |
126 } | 126 } |
127 -re ".*alloca .i - 4.*$gdb_prompt $" { | 127 -re ".*alloca .i - 4.*$gdb_prompt $" { |
128 set description "next over conditional stack alignment alloca" | 128 set description "next over conditional stack alignment alloca" |
129 set command "next" | 129 set command "next" |
130 } | 130 } |
131 -re ".*cmdsize = 1.*$gdb_prompt $" { | |
132 set description "step over cmdsize initialization" | |
133 set command "next" | |
134 } | |
135 -re ".*cmdarg = .* xmalloc.*$gdb_prompt $" { | |
136 set description "next over cmdarg initialization via xmalloc" | |
137 set command "next" | |
138 } | |
139 -re ".*ncmd = 0.*$gdb_prompt $" { | |
140 set description "next over ncmd initialization" | |
141 set command "next" | |
142 } | |
143 -re ".*dirsize = 1.*$gdb_prompt $" { | 131 -re ".*dirsize = 1.*$gdb_prompt $" { |
144 set description "next over dirsize initialization" | 132 set description "next over dirsize initialization" |
145 set command "next" | 133 set command "next" |
146 } | 134 } |
147 -re ".*dirarg = .* xmalloc.*$gdb_prompt $" { | 135 -re ".*dirarg = .* xmalloc.*$gdb_prompt $" { |
148 return | 136 return |
149 } | 137 } |
150 -re ".*setlocale .LC_MESSAGES,.*$gdb_prompt $" { | 138 -re ".*setlocale .LC_MESSAGES,.*$gdb_prompt $" { |
151 set description "next over setlocale LC_MESSAGES" | 139 set description "next over setlocale LC_MESSAGES" |
152 set command "next" | 140 set command "next" |
153 } | 141 } |
154 -re ".*setlocale .LC_CTYPE,.*$gdb_prompt $" { | 142 -re ".*setlocale .LC_CTYPE,.*$gdb_prompt $" { |
155 set description "next over setlocale LC_CTYPE" | 143 set description "next over setlocale LC_CTYPE" |
156 set command "next" | 144 set command "next" |
157 } | 145 } |
158 -re ".*bindtextdomain .PACKAGE, LOCALEDIR.;.*$gdb_prompt $" { | 146 -re ".*bindtextdomain .PACKAGE, LOCALEDIR.;.*$gdb_prompt $" { |
159 set description "next over bindtextdomain" | 147 set description "next over bindtextdomain" |
160 set command "next" | 148 set command "next" |
161 } | 149 } |
162 -re ".*textdomain .PACKAGE.;.*$gdb_prompt $" { | 150 -re ".*textdomain .PACKAGE.;.*$gdb_prompt $" { |
163 set description "next over textdomain PACKAGE" | 151 set description "next over textdomain PACKAGE" |
164 set command "next" | 152 set command "next" |
165 } | 153 } |
| 154 -re ".*VEC_cleanup .cmdarg_s.*$gdb_prompt $" { |
| 155 set description "next over cmdarg_s VEC_cleanup" |
| 156 set command "next" |
| 157 } |
166 -re "\[0-9\]+\[\t \]+\{\r\n$gdb_prompt $" { | 158 -re "\[0-9\]+\[\t \]+\{\r\n$gdb_prompt $" { |
167 set description "step over initial brace" | 159 set description "step over initial brace" |
168 set command "step" | 160 set command "step" |
169 } | 161 } |
170 -re ".*current_directory = gdb_dirbuf.*$gdb_prompt $" { | 162 -re ".*current_directory = gdb_dirbuf.*$gdb_prompt $" { |
171 set description "step over current_directory initialization" | 163 set description "step over current_directory initialization" |
172 set command "step" | 164 set command "step" |
173 } | 165 } |
174 -re ".*gdb_sysroot = .*$gdb_prompt $" { | 166 -re ".*gdb_sysroot = .*$gdb_prompt $" { |
175 # NOTE: carlton/2003-01-15: More optimization reordering, | 167 # NOTE: carlton/2003-01-15: More optimization reordering, |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 } | 383 } |
392 -re ".*No such file or directory.\r\n$gdb_prompt $" { | 384 -re ".*No such file or directory.\r\n$gdb_prompt $" { |
393 pass "$description (no source available)" | 385 pass "$description (no source available)" |
394 } | 386 } |
395 -re "A file or directory .* does not exist..\r\n$gdb_prompt $" { | 387 -re "A file or directory .* does not exist..\r\n$gdb_prompt $" { |
396 pass "$description (no source available)" | 388 pass "$description (no source available)" |
397 } | 389 } |
398 } | 390 } |
399 | 391 |
400 # start the "xgdb" process | 392 # start the "xgdb" process |
401 gdb_test_multiple "continue" "xgdb is at prompt" { | 393 if [target_info exists gdb,noinferiorio] { |
402 » -re "GNU gdb \[0-9\.\]*.*Copyright \\(C\\) \[0-9\]* Free Software Founda
tion, Inc.*License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/licenses
/gpl.html>.*This is free software: you are free to change and redistribute it.*T
here is NO WARRANTY, to the extent permitted by law. Type \"show copying\".*and
\"show warranty\" for details.*This GDB was configured as .*$gdb_prompt $" { | 394 » # Maybe testing with a local extended-remote gdbserver. With |
403 » pass "xgdb is at prompt" | 395 » # no way to interact with inferior GDB, all we can do is let |
| 396 » # it run. |
| 397 » send_gdb "continue\n" |
| 398 » # Wait a bit while the inferior gdb gets to its prompt. |
| 399 » sleep 1 |
| 400 } else { |
| 401 » set test "xgdb is at prompt" |
| 402 » gdb_test_multiple "continue" $test { |
| 403 » -re "GNU gdb \[0-9\.\]*.*Copyright \\(C\\) \[0-9\]* Free Software Fo
undation, Inc.*License GPLv3\\+: GNU GPL version 3 or later <http://gnu.org/lice
nses/gpl.html>.*This is free software: you are free to change and redistribute i
t.*There is NO WARRANTY, to the extent permitted by law. Type \"show copying\".
*and \"show warranty\" for details.*This GDB was configured as .*$gdb_prompt $"
{ |
| 404 » » pass $test |
| 405 » } |
| 406 » } |
| 407 |
| 408 » # set xgdb prompt so we can tell which is which |
| 409 » gdb_test_multiple "set prompt (xgdb) " "Set xgdb_prompt" { |
| 410 » -re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { |
| 411 » » pass "Set xgdb prompt" |
| 412 » } |
404 } | 413 } |
405 } | 414 } |
406 | 415 |
407 # set xgdb prompt so we can tell which is which | |
408 gdb_test_multiple "set prompt (xgdb) " "Set xgdb_prompt" { | |
409 » -re "\[(\]xgdb\[)\].*\[(\]xgdb\[)\] $" { | |
410 » pass "Set xgdb prompt" | |
411 » } | |
412 } | |
413 | |
414 # kill the xgdb process | 416 # kill the xgdb process |
415 set description "send ^C to child process" | 417 set description "send ^C to child process" |
416 send_gdb "\003" | 418 send_gdb "\003" |
417 gdb_expect { | 419 gdb_expect { |
418 -re "Program received signal SIGINT.*$gdb_prompt $" { | 420 -re "Program received signal SIGINT.*$gdb_prompt $" { |
419 pass "$description" | 421 pass "$description" |
420 } | 422 } |
421 -re ".*$gdb_prompt $" { | 423 -re ".*$gdb_prompt $" { |
422 fail "$description" | 424 fail "$description" |
423 } | 425 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 gdb_start | 499 gdb_start |
498 set file [remote_download host $GDB_FULLPATH x$tool] | 500 set file [remote_download host $GDB_FULLPATH x$tool] |
499 set result [test_with_self $file]; | 501 set result [test_with_self $file]; |
500 gdb_exit; | 502 gdb_exit; |
501 catch "remote_file host delete $file"; | 503 catch "remote_file host delete $file"; |
502 | 504 |
503 if {$result <0} then { | 505 if {$result <0} then { |
504 warning "Couldn't test self" | 506 warning "Couldn't test self" |
505 return -1 | 507 return -1 |
506 } | 508 } |
OLD | NEW |