[PATCH] kdb: Put a cr before lf when working w/ a non open console port

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/




[Index of Archives]

  Powered by Linux

[Older Kernel Discussion]     [Yosemite National Park Forum]     [Large Format Photos]     [Gimp]     [Yosemite Photos]     [Stuff]     [Index of Other Archives]