lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1397841448-12942-1-git-send-email-dianders@chromium.org>
Date:	Fri, 18 Apr 2014 10:17:28 -0700
From:	Doug Anderson <dianders@...omium.org>
To:	Jason Wessel <jason.wessel@...driver.com>
Cc:	Doug Anderson <dianders@...omium.org>,
	kgdb-bugreport@...ts.sourceforge.net, linux-kernel@...r.kernel.org
Subject: [PATCH] kdb: Put a cr before lf when working w/ a non open console port

In (efe2f29 kgdboc,kdb: Allow kdb to work on a non open console port)
support was added to directly use the "write_char" functions when
doing kdb over a non-open console port.  This is great, but it ends up
bypassing the normal code in uart_console_write() that adds a carriage
return before any newlines.

Add similar code in kdb so we don't get things like:
[0]kdb>
       [0]kdb>
              [0]kdb>

Signed-off-by: Doug Anderson <dianders@...omium.org>
---
 kernel/debug/kdb/kdb_io.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
index 14ff484..513ed44 100644
--- a/kernel/debug/kdb/kdb_io.c
+++ b/kernel/debug/kdb/kdb_io.c
@@ -698,6 +698,9 @@ kdb_printit:
 			len = retlen;
 			cp = kdb_buffer;
 			while (len--) {
+				if (*cp == '\n')
+					dbg_io_ops->write_char('\r');
+
 				dbg_io_ops->write_char(*cp);
 				cp++;
 			}
@@ -759,6 +762,9 @@ kdb_printit:
 			len = strlen(moreprompt);
 			cp = moreprompt;
 			while (len--) {
+				if (*cp == '\n')
+					dbg_io_ops->write_char('\r');
+
 				dbg_io_ops->write_char(*cp);
 				cp++;
 			}
-- 
1.9.1.423.g4596e3a

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ