]>
Commit | Line | Data |
---|---|---|
1d506c26 | 1 | # Copyright (C) 2021-2024 Free Software Foundation, Inc. |
84b33497 TT |
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 | # Do not run if gdb debug is enabled as it will interfere with log redirect. | |
e5bf39c5 | 17 | require !gdb_debug_enabled |
84b33497 TT |
18 | |
19 | gdb_start | |
20 | ||
84b33497 TT |
21 | gdb_test_no_output "set height 5" |
22 | gdb_test_no_output "set pagination on" | |
23 | ||
24 | # Test that logging redirect disables the pager. | |
25 | set log_name [standard_output_file log.txt] | |
26 | gdb_test_no_output "set logging file $log_name" \ | |
27 | "set logging filename" | |
28 | gdb_test_no_output "set logging redirect on" | |
29 | gdb_test "set logging enabled on" "Copying debug output to .*" | |
30 | set ok 1 | |
31 | set str "1\\n2\\n3\\n4\\n5\\n" | |
32 | gdb_test_multiple "printf \"$str\"" "printf without paging" { | |
33 | -re "$pagination_prompt" { | |
34 | set ok 0 | |
35 | send_gdb "c\n" | |
36 | exp_continue | |
37 | } | |
38 | -re "\r\n$gdb_prompt $" { | |
39 | # Ok. | |
40 | } | |
41 | } | |
42 | if {$ok} { | |
43 | pass "printf without paging" | |
44 | } else { | |
45 | fail "printf without paging" | |
46 | } | |
47 | gdb_test "set logging enabled off" "Done logging to .*" | |
93f3b8ee TT |
48 | |
49 | set cmd "interpreter-exec mi2 \"-data-evaluate-expression 23\"" | |
50 | gdb_test_multiple $cmd $cmd { | |
51 | -re ".done.value=.23\[^\n\]+\r\n$gdb_prompt " { | |
52 | pass "$cmd" | |
53 | gdb_expect 1 { | |
54 | -re "\r\n$gdb_prompt $" { } | |
55 | } | |
56 | } | |
57 | } |