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