| OLD | NEW |
| 1 # Copyright 2008-2012 Free Software Foundation, Inc. | 1 # Copyright 2008-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 # This tests the find command. | 16 # This tests the find command. |
| 17 | 17 |
| 18 if $tracelevel then { | |
| 19 strace $tracelevel | |
| 20 } | |
| 21 | |
| 22 set testfile "find" | 18 set testfile "find" |
| 23 set srcfile ${testfile}.c | 19 set srcfile ${testfile}.c |
| 24 set binfile ${objdir}/${subdir}/${testfile} | 20 set binfile ${objdir}/${subdir}/${testfile} |
| 25 | 21 |
| 26 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug nowarnings}] != "" } { | 22 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug nowarnings}] != "" } { |
| 27 untested find.exp | 23 untested find.exp |
| 28 return -1 | 24 return -1 |
| 29 } | 25 } |
| 30 | 26 |
| 31 gdb_exit | 27 gdb_exit |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 "${hex_number}.*<int8_search_buf\\+10>${one_pattern_found}" \ | 76 "${hex_number}.*<int8_search_buf\\+10>${one_pattern_found}" \ |
| 81 "pattern found at end of range" | 77 "pattern found at end of range" |
| 82 | 78 |
| 83 # Test max-count, $_ and $numfound. | 79 # Test max-count, $_ and $numfound. |
| 84 | 80 |
| 85 gdb_test "find /1 &int8_search_buf\[0\], +sizeof(int8_search_buf), 'a', 'a', 'a'
" \ | 81 gdb_test "find /1 &int8_search_buf\[0\], +sizeof(int8_search_buf), 'a', 'a', 'a'
" \ |
| 86 "${hex_number}.*<int8_search_buf\\+10>${one_pattern_found}" \ | 82 "${hex_number}.*<int8_search_buf\\+10>${one_pattern_found}" \ |
| 87 "max-count" | 83 "max-count" |
| 88 | 84 |
| 89 gdb_test "print \$_" \ | 85 gdb_test "print \$_" \ |
| 90 "${history_prefix}.*${hex_number}" \ | 86 "${history_prefix}.*${hex_number} <int8_search_buf\\+10>" \ |
| 91 "\$_" | 87 "\$_" |
| 92 | 88 |
| 93 gdb_test "print \$numfound" \ | 89 gdb_test "print \$numfound" \ |
| 94 "${history_prefix}1" \ | 90 "${history_prefix}1" \ |
| 95 "\$numfound" | 91 "\$numfound" |
| 96 | 92 |
| 97 # Test max-count with size-char. | 93 # Test max-count with size-char. |
| 98 # They can be specified in either order. | 94 # They can be specified in either order. |
| 99 | 95 |
| 100 gdb_test "find /1b &int8_search_buf\[0\], +sizeof(int8_search_buf), 0x61, 0x61,
0x61" \ | 96 gdb_test "find /1b &int8_search_buf\[0\], +sizeof(int8_search_buf), 0x61, 0x61,
0x61" \ |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 "search spanning large range" | 175 "search spanning large range" |
| 180 | 176 |
| 181 # For native targets, test a pattern straddling a chunk boundary. | 177 # For native targets, test a pattern straddling a chunk boundary. |
| 182 | 178 |
| 183 if [isnative] { | 179 if [isnative] { |
| 184 gdb_test_no_output "set *(int32_t*) &search_buf\[${CHUNK_SIZE}-1\] = 0xfdb97
531" "" | 180 gdb_test_no_output "set *(int32_t*) &search_buf\[${CHUNK_SIZE}-1\] = 0xfdb97
531" "" |
| 185 gdb_test "find /w search_buf, +search_buf_size, 0xfdb97531" \ | 181 gdb_test "find /w search_buf, +search_buf_size, 0xfdb97531" \ |
| 186 "${hex_number}${one_pattern_found}" \ | 182 "${hex_number}${one_pattern_found}" \ |
| 187 "find pattern straddling chunk boundary" | 183 "find pattern straddling chunk boundary" |
| 188 } | 184 } |
| 185 |
| 186 # Check GDB buffer overflow. |
| 187 gdb_test "find int64_search_buf, +64/8*100, int64_search_buf" " <int64_search_bu
f>\r\n1 pattern found\\." |
| OLD | NEW |