1 # Copyright (C) 2021-2023 Free Software Foundation, Inc.
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.
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.
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/>.
16 # Do not run if gdb debug is enabled as it will interfere with log redirect.
17 require !gdb_debug_enabled
21 gdb_test_no_output "set height 5"
22 gdb_test_no_output "set pagination on"
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 .*"
31 set str "1\\n2\\n3\\n4\\n5\\n"
32 gdb_test_multiple "printf \"$str\"" "printf without paging" {
33 -re "$pagination_prompt" {
38 -re "\r\n$gdb_prompt $" {
43 pass "printf without paging"
45 fail "printf without paging"
47 gdb_test "set logging enabled off" "Done logging to .*"
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 " {
54 -re "\r\n$gdb_prompt $" { }