From patchwork Thu Sep 11 12:29:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Thompson X-Patchwork-Id: 37248 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f72.google.com (mail-yh0-f72.google.com [209.85.213.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A46EF20454 for ; Thu, 11 Sep 2014 12:30:05 +0000 (UTC) Received: by mail-yh0-f72.google.com with SMTP id f73sf15890479yha.3 for ; Thu, 11 Sep 2014 05:30:05 -0700 (PDT) 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=3qXes4g2zx4KC/F471Kk2XiQTpW9KKOp3/lEt3siBWg=; b=ZGgYgZ6IPNrVO5Sxjc49Qjmgd6SBofGf5kqMHAgUKF+vCVAVydK+/sCiGKsIHBtVTr xbDHFb8ymRtWu196ghOAmTgXZX+1qhmFWydPyIQ67e1xgx+XZTqQfikvoRrMNvHE5W03 CpgRxBrBpCdeqr2tNIUyHDAIpzIrQN/A3Da0sPG5XZVw+UVmMNvNLSG4op89xx0m2lzB GhVez+v9h3/cMqAqZBkiJco67TnwUNIf3i5JK7Uk2HnUih8EqFwezzn7a2O5hQN3dZxa 2K+tXI5wcW3d/Fxu0bemo9p4MX8g7FNlRDqc/JjTHun5we1qvSU5YAue2NyFTUfj6LRZ aUnw== X-Gm-Message-State: ALoCoQkKHcQ6VyXl3NiIBYpanBxi79hF8cKk6hQ8u6uqyQVg74jDHoKSLN7qNMJ+XkqA+Zve2CkA X-Received: by 10.236.119.231 with SMTP id n67mr333631yhh.20.1410438605477; Thu, 11 Sep 2014 05:30:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.43.181 with SMTP id e50ls144020qga.20.gmail; Thu, 11 Sep 2014 05:30:05 -0700 (PDT) X-Received: by 10.220.250.142 with SMTP id mo14mr384302vcb.26.1410438605344; Thu, 11 Sep 2014 05:30:05 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id wa16si254876vdc.51.2014.09.11.05.30.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 05:30:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.173 as permitted sender) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id le20so6027517vcb.32 for ; Thu, 11 Sep 2014 05:30:05 -0700 (PDT) X-Received: by 10.220.169.72 with SMTP id x8mr306176vcy.45.1410438605178; Thu, 11 Sep 2014 05:30:05 -0700 (PDT) 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.221.45.67 with SMTP id uj3csp583410vcb; Thu, 11 Sep 2014 05:30:04 -0700 (PDT) X-Received: by 10.180.187.198 with SMTP id fu6mr1785306wic.57.1410438604253; Thu, 11 Sep 2014 05:30:04 -0700 (PDT) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) by mx.google.com with ESMTPS id hu1si1543696wib.22.2014.09.11.05.30.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Sep 2014 05:30:02 -0700 (PDT) Received-SPF: pass (google.com: domain of daniel.thompson@linaro.org designates 74.125.82.52 as permitted sender) client-ip=74.125.82.52; Received: by mail-wg0-f52.google.com with SMTP id x13so6216791wgg.11 for ; Thu, 11 Sep 2014 05:30:01 -0700 (PDT) X-Received: by 10.180.20.6 with SMTP id j6mr1889697wie.64.1410438601671; Thu, 11 Sep 2014 05:30:01 -0700 (PDT) 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 hy9sm1062932wjb.27.2014.09.11.05.30.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Sep 2014 05:30:00 -0700 (PDT) From: Daniel Thompson To: Jason Wessel Cc: Daniel Thompson , patches@linaro.org, linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, Ingo Molnar , John Stultz , Sumit Semwal Subject: [PATCH 3.17-rc4 1/3] kdb: Fix a prompt management bug when using | grep Date: Thu, 11 Sep 2014 13:29:37 +0100 Message-Id: <1410438579-7839-2-git-send-email-daniel.thompson@linaro.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1410438579-7839-1-git-send-email-daniel.thompson@linaro.org> References: <1410438579-7839-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.220.173 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 the kdb_grepping_flag is cleared when 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';