From patchwork Thu Nov 6 16:02:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 40344 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AF58420C4E for ; Thu, 6 Nov 2014 16:02:50 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id n15sf847548lbi.6 for ; Thu, 06 Nov 2014 08:02:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=75ju8iQtuBtzzn9aXhWDUBtprBpF9gf07BA1s2Dt0+Q=; b=hrw64eWVGnCp/57CRinmpp6Qxq6J32eNoyT70X3+b953a/tBfSewNOdGV2JdcRR0La 6F9A1+TD3JLUDNlLMEMugqp38w+vLlzSW47FJtIq4wlMcxeQgQLZFxCt6xHHpEpzTY+D O6+Gfj7jc2Wf2JrB/xpnzdr6wkdsMmGAP612T3di1sMiVIJ2NDSFuXfflBYJNHKe5QV9 ZMYsC+bXEcVjg+EBY2EOrc+WvmAECxZPE28B8AFp8ptncMwTIqjriujqsPkQ22936zzy yiUWfjlMRziTQvdytXN0ZNcGTRjpHomAyHEjYz9TZcCCSicuRn3Cm1ks5pHPNEt+Q0dh aGCA== X-Gm-Message-State: ALoCoQlyWgWxMpIbHMm8RzQYBWNjUAvvVziHp7mqmxEK/MhZiSPvqWrfYN0xWvwh6B5APQaTeJhf X-Received: by 10.112.162.6 with SMTP id xw6mr604722lbb.4.1415289769576; Thu, 06 Nov 2014 08:02:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.5 with SMTP id o5ls114168lao.3.gmail; Thu, 06 Nov 2014 08:02:49 -0800 (PST) X-Received: by 10.152.116.102 with SMTP id jv6mr180541lab.40.1415289769251; Thu, 06 Nov 2014 08:02:49 -0800 (PST) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by mx.google.com with ESMTPS id mj1si11970948lbc.40.2014.11.06.08.02.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 08:02:49 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id z12so1134996lbi.22 for ; Thu, 06 Nov 2014 08:02:49 -0800 (PST) X-Received: by 10.112.52.37 with SMTP id q5mr5861727lbo.32.1415289769063; Thu, 06 Nov 2014 08:02:49 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp66824lbc; Thu, 6 Nov 2014 08:02:48 -0800 (PST) X-Received: by 10.194.48.116 with SMTP id k20mr7136562wjn.7.1415289768454; Thu, 06 Nov 2014 08:02:48 -0800 (PST) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com. [209.85.212.174]) by mx.google.com with ESMTPS id ft8si2990104wjb.111.2014.11.06.08.02.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 06 Nov 2014 08:02:48 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.174 as permitted sender) client-ip=209.85.212.174; Received: by mail-wi0-f174.google.com with SMTP id d1so1947831wiv.1 for ; Thu, 06 Nov 2014 08:02:48 -0800 (PST) X-Received: by 10.194.3.2 with SMTP id 2mr6881279wjy.89.1415289768005; Thu, 06 Nov 2014 08:02:48 -0800 (PST) Received: from sundance.lan (cpc4-aztw19-0-0-cust157.18-1.cable.virginm.net. [82.33.25.158]) by mx.google.com with ESMTPSA id j8sm20030372wib.10.2014.11.06.08.02.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Nov 2014 08:02:47 -0800 (PST) From: Daniel Thompson To: Jason Wessel Cc: Daniel Thompson , linux-kernel@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Andrew Morton , Ingo Molnar , patches@linaro.org, linaro-kernel@lists.linaro.org, John Stultz , Sumit Semwal Subject: [RESEND PATCH 3.18-rc3 1/3] kdb: Fix a prompt management bug when using | grep Date: Thu, 6 Nov 2014 16:02:24 +0000 Message-Id: <1415289746-30917-2-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1415289746-30917-1-git-send-email-daniel.thompson@linaro.org> References: <1410438579-7839-1-git-send-email-daniel.thompson@linaro.org> <1415289746-30917-1-git-send-email-daniel.thompson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: daniel.thompson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.177 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Currently when the "| grep" feature is used to filter the output of a command then the prompt is not displayed for the subsequent command. Likewise any characters typed by the user are also not echoed to the display. This rather disconcerting problem eventually corrects itself when the user presses Enter and the kdb_grepping_flag is cleared as kdb_parse() tries to make sense of whatever they typed. This patch resolves the problem by moving the clearing of this flag from the middle of command processing to the beginning. Signed-off-by: Daniel Thompson --- kernel/debug/kdb/kdb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 379650b..9d10cb2 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -872,13 +872,12 @@ int kdb_parse(const char *cmdstr) char *cp; char *cpp, quoted; kdbtab_t *tp; - int i, escaped, ignore_errors = 0, check_grep; + int i, escaped, ignore_errors = 0, check_grep = 0; /* * First tokenize the command string. */ cp = (char *)cmdstr; - kdb_grepping_flag = check_grep = 0; if (KDB_FLAG(CMD_INTERRUPT)) { /* Previous command was interrupted, newline must not @@ -1241,6 +1240,7 @@ static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, */ kdb_nextline = 1; KDB_STATE_CLEAR(SUPPRESS); + kdb_grepping_flag = 0; cmdbuf = cmd_cur; *cmdbuf = '\0';