1 |
578 |
markom |
# Browser Window Tests
|
2 |
|
|
# Copyright 1998, 2001 Red Hat, Inc.
|
3 |
|
|
#
|
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
|
6 |
|
|
# the Free Software Foundation; either version 2 of the License, or
|
7 |
|
|
# (at your option) any later version.
|
8 |
|
|
#
|
9 |
|
|
# This program is distributed in the hope that it will be useful,
|
10 |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
|
|
# GNU General Public License for more details.
|
13 |
|
|
#
|
14 |
|
|
# You should have received a copy of the GNU General Public License
|
15 |
|
|
# along with this program; if not, write to the Free Software
|
16 |
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
17 |
|
|
|
18 |
|
|
# Please email any bugs, comments, and/or additions to this file to:
|
19 |
|
|
# bug-gdb@prep.ai.mit.edu
|
20 |
|
|
|
21 |
|
|
# This file was written by Keith Seitz (keiths@cygnus.com)
|
22 |
|
|
|
23 |
|
|
# Read in the standard defs file
|
24 |
|
|
|
25 |
|
|
if {![gdbtk_read_defs]} {
|
26 |
|
|
break
|
27 |
|
|
}
|
28 |
|
|
|
29 |
|
|
global objdir test_ran
|
30 |
|
|
set _files(stupid_initializer) -100
|
31 |
|
|
|
32 |
|
|
##### #####
|
33 |
|
|
# #
|
34 |
|
|
# Helper functions for this module #
|
35 |
|
|
# #
|
36 |
|
|
##### #####
|
37 |
|
|
|
38 |
|
|
# Set the search expression
|
39 |
|
|
proc set_regexp {exp} {
|
40 |
|
|
global browser
|
41 |
|
|
|
42 |
|
|
$browser component filt_entry delete 0 end
|
43 |
|
|
$browser component filt_entry insert 0 $exp
|
44 |
|
|
}
|
45 |
|
|
|
46 |
|
|
# Do the search
|
47 |
|
|
proc do_search {} {
|
48 |
|
|
global browser
|
49 |
|
|
$browser search
|
50 |
|
|
set m [$browser component func_box get 0 end]
|
51 |
|
|
|
52 |
|
|
return $m
|
53 |
|
|
}
|
54 |
|
|
|
55 |
|
|
# Set search to use regular expressions.
|
56 |
|
|
proc set_search_mode {val} {
|
57 |
|
|
global browser
|
58 |
|
|
pref set gdb/search/filter_mode $val
|
59 |
|
|
|
60 |
|
|
# Use configure instead of entryset: need to have
|
61 |
|
|
# combobox's command fire
|
62 |
|
|
$browser component filt_type configure -value $val
|
63 |
|
|
}
|
64 |
|
|
|
65 |
|
|
# Highlight a file
|
66 |
|
|
proc select {filename} {
|
67 |
|
|
global browser _files
|
68 |
|
|
|
69 |
|
|
if {[info exists _files($filename)]} {
|
70 |
|
|
$browser component file_box selection set $_files($filename)
|
71 |
|
|
} else {
|
72 |
|
|
set files [$browser component file_box get 0 end]
|
73 |
|
|
set i [lsearch $files $filename]
|
74 |
|
|
set _files($filename) $i
|
75 |
|
|
$browser component file_box selection set $i
|
76 |
|
|
}
|
77 |
|
|
$browser search
|
78 |
|
|
}
|
79 |
|
|
|
80 |
|
|
proc select_all {} {
|
81 |
|
|
global browser
|
82 |
|
|
|
83 |
|
|
$browser component file_all invoke
|
84 |
|
|
|
85 |
|
|
}
|
86 |
|
|
|
87 |
|
|
# clear all files
|
88 |
|
|
proc clear {} {
|
89 |
|
|
global browser
|
90 |
|
|
|
91 |
|
|
$browser component file_box selection clear 0 end
|
92 |
|
|
$browser search
|
93 |
|
|
}
|
94 |
|
|
|
95 |
|
|
##### #####
|
96 |
|
|
# #
|
97 |
|
|
# BROWSER TESTS #
|
98 |
|
|
# #
|
99 |
|
|
##### #####
|
100 |
|
|
|
101 |
|
|
# Load the test executable
|
102 |
|
|
set program [file join $objdir stack]
|
103 |
|
|
if {[catch {gdbtk_test_file $program} t]} {
|
104 |
|
|
# This isn't a test case, since if this fails, we're hosed.
|
105 |
|
|
gdbtk_test_error "loading \"$program\": $t"
|
106 |
|
|
}
|
107 |
|
|
|
108 |
|
|
# Open a browser
|
109 |
|
|
set browser [ManagedWin::open BrowserWin]
|
110 |
|
|
|
111 |
|
|
# Test: browser-1.1
|
112 |
|
|
# Desc: Check file listbox contents
|
113 |
|
|
gdbtk_test browser-1.1 {file listbox contents} {
|
114 |
|
|
set m [$browser component file_box get 0 end]
|
115 |
|
|
set f {}
|
116 |
|
|
if {[lsearch $m stack1.c] == -1} {
|
117 |
|
|
lappend f 0
|
118 |
|
|
} else {
|
119 |
|
|
lappend f 1
|
120 |
|
|
}
|
121 |
|
|
if {[lsearch $m stack2.c] == -1} {
|
122 |
|
|
lappend f 0
|
123 |
|
|
} else {
|
124 |
|
|
lappend f 1
|
125 |
|
|
}
|
126 |
|
|
|
127 |
|
|
join $f \
|
128 |
|
|
} {1 1}
|
129 |
|
|
|
130 |
|
|
# Tests 2.* test starts with search mode.
|
131 |
|
|
# Test: browser-2.1
|
132 |
|
|
# Desc: Check all files/all funcs
|
133 |
|
|
gdbtk_test browser-2.1 {all files/all funcs} {
|
134 |
|
|
set_search_mode "starts with"
|
135 |
|
|
set_regexp ""
|
136 |
|
|
select_all
|
137 |
|
|
set m [do_search]
|
138 |
|
|
set r 0
|
139 |
|
|
foreach f {extern_func1_1 extern_func1_10 extern_func1_11 extern_func1_12 \
|
140 |
|
|
extern_func1_13 extern_func1_14 extern_func1_15 extern_func1_2 \
|
141 |
|
|
extern_func1_3 extern_func1_4 extern_func1_5 extern_func1_6 \
|
142 |
|
|
extern_func1_7 extern_func1_8 extern_func1_9 func_1 \
|
143 |
|
|
func_10 func_11 func_12 func_13 \
|
144 |
|
|
func_14 func_15 func_2 func_3 \
|
145 |
|
|
func_4 func_5 func_6 func_7 \
|
146 |
|
|
func_8 func_9 main static_func_1 \
|
147 |
|
|
static_func_10 static_func_11 static_func_12 static_func_13 \
|
148 |
|
|
static_func_14 static_func_15 static_func_2 static_func_3 \
|
149 |
|
|
static_func_4 static_func_5 static_func_6 static_func_7 \
|
150 |
|
|
static_func_8 static_func_9} {
|
151 |
|
|
if {[lsearch $m $f] != -1} {
|
152 |
|
|
incr r
|
153 |
|
|
}
|
154 |
|
|
}
|
155 |
|
|
|
156 |
|
|
set r
|
157 |
|
|
} {46}
|
158 |
|
|
|
159 |
|
|
# Test: browser-2.2
|
160 |
|
|
# Desc: Check all functions in stack1.c
|
161 |
|
|
gdbtk_test browser-2.2 {all functions in stack1.c} {
|
162 |
|
|
set_regexp ""
|
163 |
|
|
clear
|
164 |
|
|
select stack1.c
|
165 |
|
|
set m [do_search]
|
166 |
|
|
|
167 |
|
|
set r 0
|
168 |
|
|
foreach f {func_1 func_10 func_11 func_12 \
|
169 |
|
|
func_13 func_14 func_15 func_2 \
|
170 |
|
|
func_3 func_4 func_5 func_6 \
|
171 |
|
|
func_7 func_8 func_9 main \
|
172 |
|
|
static_func_1 static_func_10 static_func_11 static_func_12 \
|
173 |
|
|
static_func_13 static_func_14 static_func_15 static_func_2 \
|
174 |
|
|
static_func_3 static_func_4 static_func_5 static_func_6 \
|
175 |
|
|
static_func_7 static_func_8 static_func_9} {
|
176 |
|
|
if {[lsearch $m $f] != -1} {
|
177 |
|
|
incr r
|
178 |
|
|
}
|
179 |
|
|
}
|
180 |
|
|
|
181 |
|
|
set r
|
182 |
|
|
} {31}
|
183 |
|
|
if {$test_ran} {
|
184 |
|
|
clear
|
185 |
|
|
}
|
186 |
|
|
|
187 |
|
|
# Test: browser-2.3
|
188 |
|
|
# Desc: Check all functions in stack2.c
|
189 |
|
|
gdbtk_test browser-2.3 {all functions in stack2.c} {
|
190 |
|
|
set_regexp ""
|
191 |
|
|
clear
|
192 |
|
|
select stack2.c
|
193 |
|
|
set m [do_search]
|
194 |
|
|
|
195 |
|
|
set r 0
|
196 |
|
|
foreach f {extern_func1_1 extern_func1_10 extern_func1_11 \
|
197 |
|
|
extern_func1_12 extern_func1_13 extern_func1_14 extern_func1_15 \
|
198 |
|
|
extern_func1_2 extern_func1_3 extern_func1_4 extern_func1_5 \
|
199 |
|
|
extern_func1_6 extern_func1_7 extern_func1_8 extern_func1_9} {
|
200 |
|
|
if {[lsearch $m $f] != -1} {
|
201 |
|
|
incr r
|
202 |
|
|
}
|
203 |
|
|
}
|
204 |
|
|
|
205 |
|
|
set r
|
206 |
|
|
} {15}
|
207 |
|
|
if {$test_ran} {
|
208 |
|
|
clear
|
209 |
|
|
}
|
210 |
|
|
|
211 |
|
|
# Test: browser-2.4
|
212 |
|
|
# Desc: Check for all functions matching "func" - mode starts with
|
213 |
|
|
gdbtk_test browser-2.4 {all functions matching "func" - "mode starts with"} {
|
214 |
|
|
set_search_mode "starts with"
|
215 |
|
|
select_all
|
216 |
|
|
set_regexp func
|
217 |
|
|
do_search
|
218 |
|
|
} {func_1 func_10 func_11 func_12 func_13 func_14 func_15 func_2 func_3 func_4 func_5 func_6 func_7 func_8 func_9}
|
219 |
|
|
|
220 |
|
|
# Test: browser-2.5
|
221 |
|
|
# Desc: Check all functions matching "func" in stack1.c - mode starts with
|
222 |
|
|
gdbtk_test browser-2.5 {all functions matching "func" in stack1.c - "mode starts with"} {
|
223 |
|
|
set_search_mode "starts with"
|
224 |
|
|
set_regexp func
|
225 |
|
|
clear
|
226 |
|
|
select stack1.c
|
227 |
|
|
do_search
|
228 |
|
|
} {func_1 func_10 func_11 func_12 func_13 func_14 func_15 func_2 func_3 func_4 func_5 func_6 func_7 func_8 func_9}
|
229 |
|
|
|
230 |
|
|
# Test: browser-2.6
|
231 |
|
|
# Desc: Check all functions matching "funcs" in stack2.c - mode starts with
|
232 |
|
|
gdbtk_test browser-2.6 {all functions matching "func" in stack2.c - mode "starts with"} {
|
233 |
|
|
set_search_mode "starts with"
|
234 |
|
|
set_regexp func
|
235 |
|
|
clear
|
236 |
|
|
select stack2.c
|
237 |
|
|
do_search
|
238 |
|
|
} {}
|
239 |
|
|
if {$test_ran} {
|
240 |
|
|
clear
|
241 |
|
|
}
|
242 |
|
|
|
243 |
|
|
# Test: browser-2.7
|
244 |
|
|
# Desc: Check all functions matching "foobar"
|
245 |
|
|
gdbtk_test browser-2.7 {all functions matching "foobar"} {
|
246 |
|
|
set_search_mode "starts with"
|
247 |
|
|
select_all
|
248 |
|
|
set_regexp foobar
|
249 |
|
|
do_search
|
250 |
|
|
} {}
|
251 |
|
|
|
252 |
|
|
# Test: browser-2.8
|
253 |
|
|
# Desc: Check all functions matching "foobar" in stack1.c
|
254 |
|
|
gdbtk_test browser-2.8 {functions matching "foobar" in stack1.c} {
|
255 |
|
|
set_search_mode "starts with"
|
256 |
|
|
set_regexp foobar
|
257 |
|
|
clear
|
258 |
|
|
select stack1.c
|
259 |
|
|
do_search
|
260 |
|
|
} {}
|
261 |
|
|
|
262 |
|
|
# Tests 3.* test "contains" search mode.
|
263 |
|
|
# Test: browser-3.1
|
264 |
|
|
# Desc: Check all files/all funcs
|
265 |
|
|
gdbtk_test browser-3.1 {all files/all funcs} {
|
266 |
|
|
set_search_mode "contains"
|
267 |
|
|
set_regexp ""
|
268 |
|
|
select_all
|
269 |
|
|
set m [do_search]
|
270 |
|
|
set r 0
|
271 |
|
|
foreach f {extern_func1_1 extern_func1_10 extern_func1_11 extern_func1_12 \
|
272 |
|
|
extern_func1_13 extern_func1_14 extern_func1_15 extern_func1_2 \
|
273 |
|
|
extern_func1_3 extern_func1_4 extern_func1_5 extern_func1_6 \
|
274 |
|
|
extern_func1_7 extern_func1_8 extern_func1_9 func_1 \
|
275 |
|
|
func_10 func_11 func_12 func_13 \
|
276 |
|
|
func_14 func_15 func_2 func_3 \
|
277 |
|
|
func_4 func_5 func_6 func_7 \
|
278 |
|
|
func_8 func_9 main static_func_1 \
|
279 |
|
|
static_func_10 static_func_11 static_func_12 static_func_13 \
|
280 |
|
|
static_func_14 static_func_15 static_func_2 static_func_3 \
|
281 |
|
|
static_func_4 static_func_5 static_func_6 static_func_7 \
|
282 |
|
|
static_func_8 static_func_9} {
|
283 |
|
|
if {[lsearch $m $f] != -1} {
|
284 |
|
|
incr r
|
285 |
|
|
}
|
286 |
|
|
}
|
287 |
|
|
|
288 |
|
|
set r
|
289 |
|
|
} {46}
|
290 |
|
|
|
291 |
|
|
# Test: browser-3.2
|
292 |
|
|
# Desc: Check all functions in stack1.c
|
293 |
|
|
gdbtk_test browser-3.2 {all functions in stack1.c} {
|
294 |
|
|
set_regexp ""
|
295 |
|
|
set_search_mode "contains"
|
296 |
|
|
clear
|
297 |
|
|
select stack1.c
|
298 |
|
|
set m [do_search]
|
299 |
|
|
|
300 |
|
|
set r 0
|
301 |
|
|
foreach f {func_1 func_10 func_11 func_12 \
|
302 |
|
|
func_13 func_14 func_15 func_2 \
|
303 |
|
|
func_3 func_4 func_5 func_6 \
|
304 |
|
|
func_7 func_8 func_9 main \
|
305 |
|
|
static_func_1 static_func_10 static_func_11 static_func_12 \
|
306 |
|
|
static_func_13 static_func_14 static_func_15 static_func_2 \
|
307 |
|
|
static_func_3 static_func_4 static_func_5 static_func_6 \
|
308 |
|
|
static_func_7 static_func_8 static_func_9} {
|
309 |
|
|
if {[lsearch $m $f] != -1} {
|
310 |
|
|
incr r
|
311 |
|
|
}
|
312 |
|
|
}
|
313 |
|
|
|
314 |
|
|
set r
|
315 |
|
|
} {31}
|
316 |
|
|
|
317 |
|
|
if {$test_ran} {
|
318 |
|
|
clear
|
319 |
|
|
}
|
320 |
|
|
|
321 |
|
|
# Test: browser-3.3
|
322 |
|
|
# Desc: Check all functions in stack2.c
|
323 |
|
|
gdbtk_test browser-3.3 {all functions in stack2.c} {
|
324 |
|
|
set_regexp ""
|
325 |
|
|
set_search_mode "contains"
|
326 |
|
|
clear
|
327 |
|
|
select stack2.c
|
328 |
|
|
set m [do_search]
|
329 |
|
|
|
330 |
|
|
set r 0
|
331 |
|
|
foreach f {extern_func1_1 extern_func1_10 extern_func1_11 \
|
332 |
|
|
extern_func1_12 extern_func1_13 extern_func1_14 extern_func1_15 \
|
333 |
|
|
extern_func1_2 extern_func1_3 extern_func1_4 extern_func1_5 \
|
334 |
|
|
extern_func1_6 extern_func1_7 extern_func1_8 extern_func1_9} {
|
335 |
|
|
if {[lsearch $m $f] != -1} {
|
336 |
|
|
incr r
|
337 |
|
|
}
|
338 |
|
|
}
|
339 |
|
|
|
340 |
|
|
set r
|
341 |
|
|
} {15}
|
342 |
|
|
if {$test_ran} {
|
343 |
|
|
clear
|
344 |
|
|
}
|
345 |
|
|
|
346 |
|
|
# Test: browser-3.4
|
347 |
|
|
# Desc: Check for all functions matching "func" - mode contains
|
348 |
|
|
gdbtk_test browser-3.4 {all functions matching "func_1" - "mode contains"} {
|
349 |
|
|
set_search_mode "contains"
|
350 |
|
|
set_regexp "func_1"
|
351 |
|
|
select_all
|
352 |
|
|
do_search
|
353 |
|
|
} {func_1 func_10 func_11 func_12 func_13 func_14 func_15 static_func_1 static_func_10 static_func_11 static_func_12 static_func_13 static_func_14 static_func_15}
|
354 |
|
|
|
355 |
|
|
# Test: browser-3.5
|
356 |
|
|
# Desc: Check all functions matching "func_1" in stack1.c - mode contains
|
357 |
|
|
gdbtk_test browser-3.5 {all functions matching "func_1" in stack1.c - "mode contains"} {
|
358 |
|
|
set_search_mode "contains"
|
359 |
|
|
set_regexp "func_1"
|
360 |
|
|
clear
|
361 |
|
|
select stack1.c
|
362 |
|
|
do_search
|
363 |
|
|
} {func_1 func_10 func_11 func_12 func_13 func_14 func_15 static_func_1 static_func_10 static_func_11 static_func_12 static_func_13 static_func_14 static_func_15}
|
364 |
|
|
|
365 |
|
|
# Test: browser-3.6
|
366 |
|
|
# Desc: Check all functions matching "func_1" in stack2.c - mode contains
|
367 |
|
|
gdbtk_test browser-3.6 {all functions matching "func" in stack2.c - mode "contains"} {
|
368 |
|
|
set_search_mode "contains"
|
369 |
|
|
set_regexp func_1
|
370 |
|
|
clear
|
371 |
|
|
select stack2.c
|
372 |
|
|
do_search
|
373 |
|
|
} {}
|
374 |
|
|
|
375 |
|
|
# Test: browser-3.7
|
376 |
|
|
# Desc: Check all functions matching "foobar"
|
377 |
|
|
gdbtk_test browser-3.7 {all functions matching "foobar"} {
|
378 |
|
|
set_search_mode "contains"
|
379 |
|
|
select_all
|
380 |
|
|
set_regexp foobar
|
381 |
|
|
do_search
|
382 |
|
|
} {}
|
383 |
|
|
|
384 |
|
|
# Test: browser-3.8
|
385 |
|
|
# Desc: Check all functions matching "foobar" in stack1.c
|
386 |
|
|
gdbtk_test browser-3.8 {functions matching "foobar" in stack1.c} {
|
387 |
|
|
set_search_mode "contains"
|
388 |
|
|
set_regexp foobar
|
389 |
|
|
clear
|
390 |
|
|
select stack1.c
|
391 |
|
|
do_search
|
392 |
|
|
} {}
|
393 |
|
|
|
394 |
|
|
# Tests 4.* test "ends with" search mode.
|
395 |
|
|
# Test: browser-4.1
|
396 |
|
|
# Desc: Check all files/all funcs
|
397 |
|
|
gdbtk_test browser-4.1 {all files/all funcs} {
|
398 |
|
|
set_search_mode "ends with"
|
399 |
|
|
set_regexp ""
|
400 |
|
|
select_all
|
401 |
|
|
set m [do_search]
|
402 |
|
|
set r 0
|
403 |
|
|
foreach f {extern_func1_1 extern_func1_10 extern_func1_11 extern_func1_12 \
|
404 |
|
|
extern_func1_13 extern_func1_14 extern_func1_15 extern_func1_2 \
|
405 |
|
|
extern_func1_3 extern_func1_4 extern_func1_5 extern_func1_6 \
|
406 |
|
|
extern_func1_7 extern_func1_8 extern_func1_9 func_1 \
|
407 |
|
|
func_10 func_11 func_12 func_13 \
|
408 |
|
|
func_14 func_15 func_2 func_3 \
|
409 |
|
|
func_4 func_5 func_6 func_7 \
|
410 |
|
|
func_8 func_9 main static_func_1 \
|
411 |
|
|
static_func_10 static_func_11 static_func_12 static_func_13 \
|
412 |
|
|
static_func_14 static_func_15 static_func_2 static_func_3 \
|
413 |
|
|
static_func_4 static_func_5 static_func_6 static_func_7 \
|
414 |
|
|
static_func_8 static_func_9} {
|
415 |
|
|
if {[lsearch $m $f] > -1} {
|
416 |
|
|
incr r
|
417 |
|
|
}
|
418 |
|
|
}
|
419 |
|
|
|
420 |
|
|
set r
|
421 |
|
|
} {46}
|
422 |
|
|
|
423 |
|
|
# Test: browser-4.2
|
424 |
|
|
# Desc: Check all functions in stack1.c
|
425 |
|
|
gdbtk_test browser-4.2 {all functions in stack1.c} {
|
426 |
|
|
set_regexp ""
|
427 |
|
|
set_search_mode "ends with"
|
428 |
|
|
clear
|
429 |
|
|
select stack1.c
|
430 |
|
|
set m [do_search]
|
431 |
|
|
|
432 |
|
|
set r 0
|
433 |
|
|
foreach f {func_1 func_10 func_11 func_12 \
|
434 |
|
|
func_13 func_14 func_15 func_2 \
|
435 |
|
|
func_3 func_4 func_5 func_6 \
|
436 |
|
|
func_7 func_8 func_9 main \
|
437 |
|
|
static_func_1 static_func_10 static_func_11 static_func_12 \
|
438 |
|
|
static_func_13 static_func_14 static_func_15 static_func_2 \
|
439 |
|
|
static_func_3 static_func_4 static_func_5 static_func_6 \
|
440 |
|
|
static_func_7 static_func_8 static_func_9} {
|
441 |
|
|
if {[lsearch $m $f] != -1} {
|
442 |
|
|
incr r
|
443 |
|
|
}
|
444 |
|
|
}
|
445 |
|
|
|
446 |
|
|
set r
|
447 |
|
|
} {31}
|
448 |
|
|
|
449 |
|
|
if {$test_ran} {
|
450 |
|
|
clear
|
451 |
|
|
}
|
452 |
|
|
|
453 |
|
|
# Test: browser-4.3
|
454 |
|
|
# Desc: Check all functions in stack2.c
|
455 |
|
|
gdbtk_test browser-4.3 {all functions in stack2.c} {
|
456 |
|
|
set_regexp ""
|
457 |
|
|
set_search_mode "ends with"
|
458 |
|
|
clear
|
459 |
|
|
select stack2.c
|
460 |
|
|
set m [do_search]
|
461 |
|
|
|
462 |
|
|
set r 0
|
463 |
|
|
foreach f {extern_func1_1 extern_func1_10 extern_func1_11 \
|
464 |
|
|
extern_func1_12 extern_func1_13 extern_func1_14 extern_func1_15 \
|
465 |
|
|
extern_func1_2 extern_func1_3 extern_func1_4 extern_func1_5 \
|
466 |
|
|
extern_func1_6 extern_func1_7 extern_func1_8 extern_func1_9} {
|
467 |
|
|
if {[lsearch $m $f] != -1} {
|
468 |
|
|
incr r
|
469 |
|
|
}
|
470 |
|
|
}
|
471 |
|
|
|
472 |
|
|
set r
|
473 |
|
|
} {15}
|
474 |
|
|
if {$test_ran} {
|
475 |
|
|
clear
|
476 |
|
|
}
|
477 |
|
|
|
478 |
|
|
# Test: browser-4.4
|
479 |
|
|
# Desc: Check for all functions matching "func_1" - mode ends with
|
480 |
|
|
gdbtk_test browser-4.4 {all functions matching "func_1" - "mode ends with"} {
|
481 |
|
|
set_search_mode "ends with"
|
482 |
|
|
set_regexp "func_1"
|
483 |
|
|
select_all
|
484 |
|
|
do_search
|
485 |
|
|
} {func_1 static_func_1}
|
486 |
|
|
|
487 |
|
|
# Test: browser-4.5
|
488 |
|
|
# Desc: Check all functions matching "func_1" in stack1.c - mode ends with
|
489 |
|
|
gdbtk_test browser-4.5 {all functions matching "func_1" in stack1.c - "mode ends with"} {
|
490 |
|
|
set_search_mode "ends with"
|
491 |
|
|
set_regexp "func_1"
|
492 |
|
|
clear
|
493 |
|
|
select stack1.c
|
494 |
|
|
do_search
|
495 |
|
|
} {func_1 static_func_1}
|
496 |
|
|
if {$test_ran} {
|
497 |
|
|
clear
|
498 |
|
|
}
|
499 |
|
|
|
500 |
|
|
# Test: browser-4.6
|
501 |
|
|
# Desc: Check all functions matching "func_1" in stack2.c - mode ends with
|
502 |
|
|
gdbtk_test browser-4.6 {all functions matching "func" in stack2.c - mode "ends with"} {
|
503 |
|
|
set_search_mode "ends with"
|
504 |
|
|
set_regexp func_1
|
505 |
|
|
clear
|
506 |
|
|
select stack2.c
|
507 |
|
|
do_search
|
508 |
|
|
} {}
|
509 |
|
|
|
510 |
|
|
# Test: browser-4.7
|
511 |
|
|
# Desc: Check all functions matching "foobar"
|
512 |
|
|
gdbtk_test browser-4.7 {all functions matching "foobar"} {
|
513 |
|
|
set_search_mode "ends with"
|
514 |
|
|
select_all
|
515 |
|
|
set_regexp foobar
|
516 |
|
|
do_search
|
517 |
|
|
} {}
|
518 |
|
|
|
519 |
|
|
# Test: browser-4.8
|
520 |
|
|
# Desc: Check all functions matching "foobar" in stack1.c
|
521 |
|
|
gdbtk_test browser-4.8 {functions matching "foobar" in stack1.c} {
|
522 |
|
|
set_search_mode "ends with"
|
523 |
|
|
set_regexp foobar
|
524 |
|
|
clear
|
525 |
|
|
select stack1.c
|
526 |
|
|
do_search
|
527 |
|
|
} {}
|
528 |
|
|
if {$test_ran} {
|
529 |
|
|
clear
|
530 |
|
|
}
|
531 |
|
|
|
532 |
|
|
# Test: browser-5.10
|
533 |
|
|
# Desc: Check all functions matching regexp "func"
|
534 |
|
|
gdbtk_test browser-5.10 {all functions matching regexp "func"} {
|
535 |
|
|
set_search_mode "matches regexp"
|
536 |
|
|
set_regexp func
|
537 |
|
|
select_all
|
538 |
|
|
do_search
|
539 |
|
|
} {extern_func1_1 extern_func1_10 extern_func1_11 extern_func1_12 extern_func1_13 extern_func1_14 extern_func1_15 extern_func1_2 extern_func1_3 extern_func1_4 extern_func1_5 extern_func1_6 extern_func1_7 extern_func1_8 extern_func1_9 func_1 func_10 func_11 func_12 func_13 func_14 func_15 func_2 func_3 func_4 func_5 func_6 func_7 func_8 func_9 static_func_1 static_func_10 static_func_11 static_func_12 static_func_13 static_func_14 static_func_15 static_func_2 static_func_3 static_func_4 static_func_5 static_func_6 static_func_7 static_func_8 static_func_9}
|
540 |
|
|
|
541 |
|
|
# Test: browser-5.11
|
542 |
|
|
# Desc: Check all functions matching regexp "func" in stack1.c
|
543 |
|
|
gdbtk_test browser-5.11 {all functions matching regexp "func" in stack1.c} {
|
544 |
|
|
set_search_mode "matches regexp"
|
545 |
|
|
set_regexp func
|
546 |
|
|
clear
|
547 |
|
|
select stack1.c
|
548 |
|
|
do_search
|
549 |
|
|
} {func_1 func_10 func_11 func_12 func_13 func_14 func_15 func_2 func_3 func_4 func_5 func_6 func_7 func_8 func_9 static_func_1 static_func_10 static_func_11 static_func_12 static_func_13 static_func_14 static_func_15 static_func_2 static_func_3 static_func_4 static_func_5 static_func_6 static_func_7 static_func_8 static_func_9}
|
550 |
|
|
|
551 |
|
|
# Test: browser-5.12
|
552 |
|
|
# Desc: Check all functions matching regexp "func" in stack2.c
|
553 |
|
|
gdbtk_test browser-5.12 {all functions matching regexp "func" in stack2.c} {
|
554 |
|
|
set_regexp func
|
555 |
|
|
clear
|
556 |
|
|
select stack2.c
|
557 |
|
|
do_search
|
558 |
|
|
} {extern_func1_1 extern_func1_10 extern_func1_11 extern_func1_12 extern_func1_13 extern_func1_14 extern_func1_15 extern_func1_2 extern_func1_3 extern_func1_4 extern_func1_5 extern_func1_6 extern_func1_7 extern_func1_8 extern_func1_9}
|
559 |
|
|
|
560 |
|
|
# Test: browser-5.13
|
561 |
|
|
# Desc: Check all functions matching regexp "\_1$"
|
562 |
|
|
gdbtk_test browser-5.13 {all functions matching regexp "\_1$"} {
|
563 |
|
|
set_search_mode "matches regexp"
|
564 |
|
|
set_regexp {\_1$}
|
565 |
|
|
select_all
|
566 |
|
|
do_search
|
567 |
|
|
} {extern_func1_1 func_1 static_func_1}
|
568 |
|
|
|
569 |
|
|
# Test: browser-5.14
|
570 |
|
|
# Desc: Check all functions matching regexp "\_1$" in stack1.c
|
571 |
|
|
gdbtk_test browser-5.14 {all functions matching regexp "\_1$" in stack1.c} {
|
572 |
|
|
set_search_mode "matches regexp"
|
573 |
|
|
set_regexp {\_1$}
|
574 |
|
|
clear
|
575 |
|
|
select stack1.c
|
576 |
|
|
do_search
|
577 |
|
|
} {func_1 static_func_1}
|
578 |
|
|
|
579 |
|
|
# Test: browser-5.15
|
580 |
|
|
# Desc: Check all functions matching regexp "\_1$" in stack2.c
|
581 |
|
|
gdbtk_test browser-5.15 {all functions matching regexp "\_1$" in stack2.c} {
|
582 |
|
|
set_search_mode "matches regexp"
|
583 |
|
|
set_regexp {\_1$}
|
584 |
|
|
clear
|
585 |
|
|
select stack2.c
|
586 |
|
|
do_search
|
587 |
|
|
} {extern_func1_1}
|
588 |
|
|
|
589 |
|
|
# Test: browser-5.16
|
590 |
|
|
# Desc: Check all functions matching regexp "foobar"
|
591 |
|
|
gdbtk_test browser-5.16 {all functions matching regexp "foobar"} {
|
592 |
|
|
set_search_mode "matches regexp"
|
593 |
|
|
set_regexp foobar
|
594 |
|
|
select_all
|
595 |
|
|
do_search
|
596 |
|
|
} {}
|
597 |
|
|
|
598 |
|
|
# Test: browser-5.17
|
599 |
|
|
# Desc: Check all functions matching regexp "foobar" in stack1.c
|
600 |
|
|
gdbtk_test browser-5.17 {all functions matching regexp "foobar" in stack1.c} {
|
601 |
|
|
set_search_mode "matches regexp"
|
602 |
|
|
set_regexp foobar
|
603 |
|
|
clear
|
604 |
|
|
select stack1.c
|
605 |
|
|
do_search
|
606 |
|
|
} {}
|
607 |
|
|
|
608 |
|
|
|
609 |
|
|
# Test: browser-6.1
|
610 |
|
|
# Desc: Check select button function
|
611 |
|
|
gdbtk_test browser-6.1 {select button - select all} {
|
612 |
|
|
clear
|
613 |
|
|
select_all
|
614 |
|
|
set m [$browser component file_box curselection]
|
615 |
|
|
|
616 |
|
|
expr {[llength $m] >= 2}
|
617 |
|
|
} {1}
|
618 |
|
|
|
619 |
|
|
# Test: browser-6.2
|
620 |
|
|
# Desc: Check that search expressions are saved
|
621 |
|
|
gdbtk_test browser-6.2 {save last search expression} {
|
622 |
|
|
set_regexp hello
|
623 |
|
|
select_all
|
624 |
|
|
do_search
|
625 |
|
|
pref get gdb/search/last_symbol
|
626 |
|
|
} {hello}
|
627 |
|
|
|
628 |
|
|
# Test: browser-7.1
|
629 |
|
|
# Desc: Toggle all bps on
|
630 |
|
|
gdbtk_test browser-7.1 {toggle_all_bp on} {
|
631 |
|
|
set_regexp {\_1$}
|
632 |
|
|
set_search_mode "matches regexp"
|
633 |
|
|
select_all
|
634 |
|
|
set funcs [do_search]
|
635 |
|
|
|
636 |
|
|
# select all to set bp on
|
637 |
|
|
$browser component func_box selection set 0 end
|
638 |
|
|
$browser component func_add_bp invoke
|
639 |
|
|
|
640 |
|
|
set bps {}
|
641 |
|
|
foreach f $funcs {
|
642 |
|
|
if {![catch {gdb_loc $f} ls]} {
|
643 |
|
|
if {[bp_exists $ls] != -1} {
|
644 |
|
|
lappend bps $f
|
645 |
|
|
}
|
646 |
|
|
}
|
647 |
|
|
}
|
648 |
|
|
|
649 |
|
|
catch {gdb_cmd "delete" 0}
|
650 |
|
|
join [lsort $bps]
|
651 |
|
|
} {extern_func1_1 func_1 static_func_1}
|
652 |
|
|
|
653 |
|
|
# Test: browser-7.2
|
654 |
|
|
# Desc: Toggle some bps off
|
655 |
|
|
gdbtk_test browser-7.2 {toggle_some_bp off} {
|
656 |
|
|
set_regexp {\_1$}
|
657 |
|
|
set_search_mode "matches regexp"
|
658 |
|
|
select_all
|
659 |
|
|
set funcs [do_search]
|
660 |
|
|
|
661 |
|
|
$browser component func_box selection set 0 end
|
662 |
|
|
$browser component func_add_bp invoke
|
663 |
|
|
|
664 |
|
|
# Turn off all the "static_func_*" bps
|
665 |
|
|
set_regexp {^static.*_1$}
|
666 |
|
|
do_search
|
667 |
|
|
$browser component func_box selection set 0 end
|
668 |
|
|
$browser component func_remove_bp invoke
|
669 |
|
|
set bps {}
|
670 |
|
|
foreach f $funcs {
|
671 |
|
|
if {![catch {gdb_loc $f} ls]} {
|
672 |
|
|
if {[bp_exists $ls] != -1} {
|
673 |
|
|
lappend bps $f
|
674 |
|
|
}
|
675 |
|
|
}
|
676 |
|
|
}
|
677 |
|
|
|
678 |
|
|
catch {gdb_cmd "delete" 0}
|
679 |
|
|
|
680 |
|
|
join [lsort $bps]
|
681 |
|
|
} {extern_func1_1 func_1}
|
682 |
|
|
|
683 |
|
|
#
|
684 |
|
|
# Exit
|
685 |
|
|
#
|
686 |
|
|
gdbtk_test_done
|