From patchwork Wed Jan 7 16:10:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 42834 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0741D2055F for ; Wed, 7 Jan 2015 16:10:28 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id r20sf941607wiv.1 for ; Wed, 07 Jan 2015 08:10:27 -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=Th/AOYfw7lNgOwlJC/+XMn4dZwkrhUKefqOPlmvydGQ=; b=dZwH3d8YEIp3ZpR27zhtKI+WCBwZujWvPAQp2q2vgFdHv1dXLljfaPBbNnCJ9yqiwF OM2WuHsx5/vjc30R3ynREOd60FJ2OFarkkDJlSi5SozCl+ikH+mNw+StB6SVLButU89F zNYv5RWiTw6DuqHcapExE6gGjvLfJr+oiWQ4GGr+k8iHh49COuGAlOejN44dY056AbMH Sfcl7QKpZeEOV4qeKMEzuFCDUKaJ5XF+A6mQJb3TCj9t6UGN7MCAM5HPbfoqoGPbxgfH JRQO+PZDDwWUXqqwRuLvRGtWiLA733buAtU19uxTzKKflQPZ2U4C8tamA4dazc6njGGg 8qTw== X-Gm-Message-State: ALoCoQn3LITg4TCi4rs+NKHltqUdbuhtKKCAp+p/TLDT47n+/oDhb1TUsyAQg5RqoU2wpjg2vJoH X-Received: by 10.180.76.40 with SMTP id h8mr3078211wiw.3.1420647027324; Wed, 07 Jan 2015 08:10:27 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.131 with SMTP id e3ls205980lam.91.gmail; Wed, 07 Jan 2015 08:10:27 -0800 (PST) X-Received: by 10.112.91.43 with SMTP id cb11mr5849829lbb.63.1420647027159; Wed, 07 Jan 2015 08:10:27 -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 bc18si3621029lab.128.2015.01.07.08.10.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 08:10:27 -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 b6so1316323lbj.36 for ; Wed, 07 Jan 2015 08:10:26 -0800 (PST) X-Received: by 10.152.115.146 with SMTP id jo18mr5994103lab.9.1420647026853; Wed, 07 Jan 2015 08:10:26 -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.9.200 with SMTP id c8csp1529081lbb; Wed, 7 Jan 2015 08:10:24 -0800 (PST) X-Received: by 10.194.77.73 with SMTP id q9mr7898197wjw.24.1420647024193; Wed, 07 Jan 2015 08:10:24 -0800 (PST) Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com. [209.85.212.170]) by mx.google.com with ESMTPS id kz5si4934572wjc.167.2015.01.07.08.10.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Jan 2015 08:10:24 -0800 (PST) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 209.85.212.170 as permitted sender) client-ip=209.85.212.170; Received: by mail-wi0-f170.google.com with SMTP id bs8so8389018wib.1 for ; Wed, 07 Jan 2015 08:10:24 -0800 (PST) X-Received: by 10.180.87.36 with SMTP id u4mr48944964wiz.20.1420647023779; Wed, 07 Jan 2015 08:10:23 -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 s4sm18370956wiy.13.2015.01.07.08.10.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jan 2015 08:10:22 -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.19-rc2 1/3] kdb: Fix a prompt management bug when using | grep Date: Wed, 7 Jan 2015 16:10:12 +0000 Message-Id: <1420647014-4897-2-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1420647014-4897-1-git-send-email-daniel.thompson@linaro.org> References: <1410438579-7839-1-git-send-email-daniel.thompson@linaro.org> <1420647014-4897-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 379650b984f8..9d10cb20cef1 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';