OSDN Git Service

modified: utilsrc/src/Admin/Makefile
[eos/others.git] / utilsrc / srcX86MAC64 / Admin / gdb-7.7.1 / gdb / testsuite / gdb.base / readline-ask.exp
1 # Copyright (C) 2011-2014 Free Software Foundation, Inc.
2 #
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
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
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/>.
15
16 standard_testfile .c
17 set inputrc ${srcdir}/${subdir}/${testfile}.inputrc
18
19 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug}] != "" } {
20     untested ${testfile}.exp
21     return -1
22 }
23
24 # INPUTRC gets reset for the next testfile.
25 setenv INPUTRC $inputrc
26 clean_restart ${binfile}
27
28 gdb_test_no_output "set width 50"
29 gdb_test_no_output "set height 3"
30
31 set cmd "p symbol_0"
32 send_gdb "$cmd\t"
33 set test "bell for more message"
34 gdb_test_multiple "" $test {
35     -re "$cmd\007$" {
36         pass $test
37     }
38 }
39
40 send_gdb "\t"
41 set test "more message for 01 and 02"
42 gdb_test_multiple "" $test {
43     -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" {
44         pass $test
45     }
46     -re "$gdb_prompt " {
47         fail $test
48     }
49 }
50
51 # There get some VT100 characters printed.
52
53 send_gdb "\r"
54 set test "more message for 03"
55 gdb_test_multiple "" $test {
56     -re "\rsymbol_03_length_40_____________________\r\n--More--$" {
57         pass $test
58     }
59 }
60
61 # "$gdb_prompt $" will not match as $cmd gets output: $gdb_prompt p symbol_0
62 # And "$gdb_prompt p symbol_0" cannot be matched as the default "$gdb_prompt $"
63 # string from gdb_test_multiple could match earlier.
64
65 send_gdb "\r"
66 set test "more finish for 04"
67 gdb_test_multiple "" $test {
68     -re "\rsymbol_04_length_40_____________________\r\n$gdb_prompt " {
69         pass $test
70     }
71 }
72
73 gdb_test "foo" {No symbol "symbol_0foo" in current context\.} "abort more message"
74
75 set cmd "p symbol_"
76 send_gdb "$cmd\t"
77 set test "bell for ask message"
78 gdb_test_multiple "" $test {
79     -re "$cmd\007$" {
80         pass $test
81     }
82 }
83
84 send_gdb "\t"
85 set test "ask message"
86 gdb_test_multiple "" $test {
87     -re "^\r\nDisplay all 5 possibilities\\? \\(y or n\\)$" {
88         pass $test
89     }
90     -re "$gdb_prompt " {
91         fail $test
92         return 0
93     }
94 }
95
96 send_gdb "y"
97 set test "ask message for 01 and 02"
98 gdb_test_multiple "" $test {
99     -re "^\r\nsymbol_01_length_40_____________________\r\nsymbol_02_length_40_____________________\r\n--More--$" {
100         pass $test
101     }
102 }
103
104 # There get some VT100 characters printed.
105 # See the "$gdb_prompt " match like in "more finish for 04".
106
107 send_gdb "n"
108 set test "ask message no"
109 gdb_test_multiple "" $test {
110     -re "\r$gdb_prompt " {
111         pass $test
112     }
113 }
114
115 gdb_test "foo" {No symbol "symbol_foo" in current context\.} "abort ask message"