]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.base/page-logging.exp
Update copyright year range in header of all files managed by GDB
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / page-logging.exp
CommitLineData
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 17require !gdb_debug_enabled
84b33497
TT
18
19gdb_start
20
84b33497
TT
21gdb_test_no_output "set height 5"
22gdb_test_no_output "set pagination on"
23
24# Test that logging redirect disables the pager.
25set log_name [standard_output_file log.txt]
26gdb_test_no_output "set logging file $log_name" \
27 "set logging filename"
28gdb_test_no_output "set logging redirect on"
29gdb_test "set logging enabled on" "Copying debug output to .*"
30set ok 1
31set str "1\\n2\\n3\\n4\\n5\\n"
32gdb_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}
42if {$ok} {
43 pass "printf without paging"
44} else {
45 fail "printf without paging"
46}
47gdb_test "set logging enabled off" "Done logging to .*"
93f3b8ee
TT
48
49set cmd "interpreter-exec mi2 \"-data-evaluate-expression 23\""
50gdb_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}