mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kdb: Put a cr before lf when working w/ a non open console port
@ 2014-04-18 17:17 Doug Anderson
  2014-04-18 23:53 ` Doug Anderson
  2014-04-21 17:06 ` [PATCH v2] serial_core: Commonalize crlf " Doug Anderson
  0 siblings, 2 replies; 4+ messages in thread
From: Doug Anderson @ 2014-04-18 17:17 UTC (permalink / raw)
  To: Jason Wessel; +Cc: Doug Anderson, kgdb-bugreport, linux-kernel

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@chromium.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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-04-22  9:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-18 17:17 [PATCH] kdb: Put a cr before lf when working w/ a non open console port Doug Anderson
2014-04-18 23:53 ` Doug Anderson
2014-04-21 17:06 ` [PATCH v2] serial_core: Commonalize crlf " Doug Anderson
2014-04-22  9:55   ` One Thousand Gnomes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®