From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id A3D323858C2F for ; Wed, 25 Jan 2023 12:09:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A3D323858C2F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674648542; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ljpvGcx0eP/75eOPtycCmnESm+iBC2Sl+xdvssHgX9A=; b=J1aotuCZdLM7U01BXI5BB9c0zb4etSMDEzLOJLPFA/xdhkBSS7vNorodeadETo6uKL3fGb K99qjpw4Vp74pO3NDccQ0DjKQOUM995sXSKLtKeIWBOCBIouhMxH3Nlc/A90ZvpjDSuUgV 42OVyDx8tbWhHx1cX8bD2ODmUIY1/WY= Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-499-PmA4qEflMruSXxJm7bGF0w-1; Wed, 25 Jan 2023 07:08:57 -0500 X-MC-Unique: PmA4qEflMruSXxJm7bGF0w-1 Received: by mail-yb1-f200.google.com with SMTP id u186-20020a2560c3000000b007c8e2cf3668so19680867ybb.14 for ; Wed, 25 Jan 2023 04:08:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ljpvGcx0eP/75eOPtycCmnESm+iBC2Sl+xdvssHgX9A=; b=1jLpE2nVXIsjlYCSHy2H5c6wtYXNyCEnlPnETdnG75J+K9M0BIcy4jOQTOQqhh999e C7JeHkzcWFszvU5dTv5xZh1lcEE2KS2GFfm+P7gxqRRZn+trEvzjy+hdxJWkf/kORbqM /uz/hiEPTUJQ/3IvFIW0P0hG4XDYuxpA7R6Ctm/KuVcoglanZlSwYJ7mqxoWHCH289cW 9WDdB5phUBwtsp1VQJKEXvyYFFi3G/5GekWacaNJjU3zlyx7Ac7WP2anyJlmQ9SC5P5N rVSAK5fe2U+CHudYLkvUYsTv1yZchQLUBlOIWsPCu0UVmhRfiuIrb73vyITi5tFGPv2E AaEA== X-Gm-Message-State: AFqh2kp03RU2iNoZvXKzFFwl0KkFTiTy8631K9RljSlCnHbYTL5hNY4s bRtF5XCv5i+o1iBjjrdJ2HnsSwwdhEF0PxU8josJaFrWvLAyBU0RsLCIOf+teVqEOv3db/RCUC3 2IToLETG+I0qV/DvcW9EIqLPWGmX2cTxlCr8xOdpAyw9Xw0zbLN4FIxsIdJhLPPEVtya3yaM+Cg == X-Received: by 2002:a25:ddc4:0:b0:701:8d69:eefb with SMTP id u187-20020a25ddc4000000b007018d69eefbmr17868911ybg.43.1674648537253; Wed, 25 Jan 2023 04:08:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXsk3IkFvHDSaE5FMbwVpHrAmXLQxg4juFXWv9h77HzCDyzyTzB2/kYbtwiXTzKLoYfThlzvYg== X-Received: by 2002:a25:ddc4:0:b0:701:8d69:eefb with SMTP id u187-20020a25ddc4000000b007018d69eefbmr17868890ybg.43.1674648536980; Wed, 25 Jan 2023 04:08:56 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id z20-20020a05620a101400b007056237b41bsm3373779qkj.67.2023.01.25.04.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Jan 2023 04:08:56 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 1/8] gdb/testsuite: fix line feed scrolling in tuiterm.exp Date: Wed, 25 Jan 2023 12:08:41 +0000 Message-Id: <11b615e8de660b1fb12ded842d8fe6aaafc58e38.1674648473.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: In a following commit I managed to trigger the line feed scrolling case in tuiterm.exp. This case is currently unhandled, and this commit fills in this missing functionality. The implementation is pretty simple, just scroll all the content up one line at a time until the cursor is back on the screen (a single line of scroll is all that should be needed). This change is untested in this commit, but is required by the next commit. --- gdb/testsuite/lib/tuiterm.exp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index c38ccbbdbd7..8a3f7a48acc 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -99,10 +99,24 @@ namespace eval Term { _log_cur "Line feed" { variable _cur_row variable _rows + variable _cols + variable _chars incr _cur_row 1 - if {$_cur_row >= $_rows} { - error "FIXME scroll" + while {$_cur_row >= $_rows} { + # Scroll the display contents. We scroll one line at + # a time here; as _cur_row was only increased by one, + # a single line scroll should be enough to put the + # cursor back on the screen. But we wrap the + # scrolling inside a while loop just to be on the safe + # side. + for {set y 0} {$y < [expr $_rows - 1]} {incr y} { + set next_y [expr $y + 1] + for {set x 0} {$x < $_cols} {incr x} { + set _chars($x,$y) $_chars($x,$next_y) + } + incr _cur_row -1 + } } } } -- 2.25.4