Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5649985ybp; Tue, 8 Oct 2019 06:21:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjqV+H4iDj/Wx5t2HxXKFOuCa3K0jcpB02VzOMOtFMc2dzZsKWxDnsq48hazsXZda9URWt X-Received: by 2002:a05:6402:32f:: with SMTP id q15mr34077611edw.143.1570540889070; Tue, 08 Oct 2019 06:21:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570540889; cv=none; d=google.com; s=arc-20160816; b=fTZfqNq3xqmNa9+foslnKcU9pSgvcckcQODR/lTB+H+4eSsHyoSvmzOjTXgdAKrk0Q 1W+O4sI58GYOSBS6vrIw9a7szFnGbJp6VLHwcXw1aie4OON6RiJE1V7P8bRz/8tScYHu b/wAb4zN45mBF0ixtO0sO1cO7qy/bAx3kVyQ8dp021R8CTDVnSDJva2KzLWOqxmebJOo VMwi+3Bpcr4zAKgJZ5b8GewbHdDppGd1IpF0rZgLSe+1321SISMe2vK3WhinRNOFo23p VAVwPMybHfv+4MTTgnRCzf13bSbjks6sJFnEsn/5gWZIP7Teh3hEw7M0ZX2LOfBFePt2 Ar/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6RWTxHt7zKzXfYPhwl9vO4EuXYxc6AyULIB2uI0LmfM=; b=K9zkcLVwucn1TOOb6Nq+c4pQfiDBzNr/oUZTSYfBdUbeP5VO3K0O77/McROHSxhr1j Wgsjnh+X5MsGayyah+xESy6JeyPxuw9AaVWFQQvcmDyafLCKkB5uZ8MjFoVitj+l011j wgJWN0gxoCBm1JXOmCTekWPfAB00XLZ7tqV3YylcyXCwncI+1whGqmaTX+Ow+kD/6x5o ZSJuH69LgJlLHn6ybmaz/Pm1bfez9DgMvl2MFgT1o0v2RUIe58NHn6vVkToY04ofie6p Zxk4sIm6L7UGoucED48TtpNWVvWrEaL+72r0PjBL7JjrDVEcIjEjSUZY/QBiIer3y/im pOaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cNq1Ed5G; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ha16si3123092ejb.258.2019.10.08.06.21.04; Tue, 08 Oct 2019 06:21:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cNq1Ed5G; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730646AbfJHNVA (ORCPT + 99 others); Tue, 8 Oct 2019 09:21:00 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:45128 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730316AbfJHNVA (ORCPT ); Tue, 8 Oct 2019 09:21:00 -0400 Received: by mail-wr1-f66.google.com with SMTP id r5so19320763wrm.12 for ; Tue, 08 Oct 2019 06:20:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6RWTxHt7zKzXfYPhwl9vO4EuXYxc6AyULIB2uI0LmfM=; b=cNq1Ed5GzasuMH1y9ug9vDcF22n6vlCP/1FO1m7fvDDoOLyWcX78rM8DONBByZA2Zb Gskb17VHPu1a9HWj7EH6TUDdxGVoicMlQ8W4qJXy+KRz5k4fm4PhFv4GHsHPJIQZ0Jqv GP5fDn3k5yyZUj3xjRbO/gO9AhSkqWdcKF8oS8v1uoaZ/BGUMHbum5nXQMcC40RhxHlV w+ByZ3LHXh9535tKnWf0DaHjjJT+4kf2nE6JHLzzUkIjNOrTvmony6bF22PctzqqJVoh vD50IGmZjnoAJS+P767MtqDmVQhDU1LXnjxuuDiKemFKb5wqjt1PLxlzpNFpd6KwOSji f6TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6RWTxHt7zKzXfYPhwl9vO4EuXYxc6AyULIB2uI0LmfM=; b=XkN7sKsUc/7JjF6zPiyXCKBYn2xLFuMIEkgm62H4VXUtTk5KY9fq2YEQkejMPePhb4 PTIXSzCLMmejKdhWoKZluslS7qKo1cYEzIpzWtWqL3tZZkSTBO+Po+RFqmXWjrf+kwrO 42yODFn7ULRMdiztPaD1k00Pkdzg8CA5rJiculq3I0mem6BcUFBMDaOK8yM7OFokNR06 uO8iC8sV1Pj9+RrWdNYQUu4eWOiY2DeFMrNvnSq0AdXn33EaOgIWQCdeCa0Viytxf+Mo fvvh83+2YMSvds4pEExpb7nhIsbm3jyuxbO3D82MzDuvWUk1aJu4XDSm8vS87Qwp3oZu vfOw== X-Gm-Message-State: APjAAAUEuvyryDlGeL68cuTKDdiFNIHTNiaJmYkyAlLpYSyn7n8Nc+/X DRMGc5aCCKg8p+/dyNxuSlNf8w== X-Received: by 2002:a05:6000:1204:: with SMTP id e4mr20944912wrx.5.1570540857894; Tue, 08 Oct 2019 06:20:57 -0700 (PDT) Received: from wychelm.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id t8sm18237214wrx.76.2019.10.08.06.20.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2019 06:20:57 -0700 (PDT) From: Daniel Thompson To: Jason Wessel , Douglas Anderson Cc: Daniel Thompson , kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, patches@linaro.org Subject: [PATCH v2 0/5] kdb: Cleanup code to read user input and handle escape sequences Date: Tue, 8 Oct 2019 14:20:38 +0100 Message-Id: <20191008132043.7966-1-daniel.thompson@linaro.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I've been meaning to repost this for some time, and inspired by having someone keen to review it, I dug it out again! I split this as carefully as I could into small pieces but the original code was complex so even in small bits it doesn't make for light reading. Things do make more sense once you realize/remember that escape_delay is a count down timer that expires the escape sequences! Most of the patches are simple tidy ups although patches 4 and 5 introduce new behaviours. Patch 4 shouldn't be controversial but perhaps patch 5 is (although hopefully not ;-) ). Mostly this is auto tested, see here: https://github.com/daniel-thompson/kgdbtest/commit/c65e28d99357c2df6dac2cebe195574e634d04dc Changes in v2: - Improve comment in patch 4 to better describe what is happening - Rebase on v5.4-rc2 Daniel Thompson (5): kdb: Tidy up code to handle escape sequences kdb: Simplify code to fetch characters from console kdb: Remove special case logic from kdb_read() kdb: Improve handling of characters from different input sources kdb: Tweak escape handling for vi users kernel/debug/kdb/kdb_io.c | 222 ++++++++++++++++++-------------------- 1 file changed, 103 insertions(+), 119 deletions(-) -- 2.21.0