alexh's projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
b5d1670
)
kernel - Have DDB print '?' for non-printable characters
author
Matthew Dillon <dillon@apollo.backplane.com>
Sat, 11 Dec 2010 21:21:03 +0000 (13:21 -0800)
committer
Matthew Dillon <dillon@apollo.backplane.com>
Sat, 11 Dec 2010 21:21:03 +0000 (13:21 -0800)
* When DDB prints something just use '?' for non-printable characters
to try to avoid messing up the screen too much.
sys/ddb/db_output.c
patch
|
blob
|
blame
|
history
diff --git
a/sys/ddb/db_output.c
b/sys/ddb/db_output.c
index
81132d8
..
dfc7784
100644
(file)
--- a/
sys/ddb/db_output.c
+++ b/
sys/ddb/db_output.c
@@
-39,6
+39,7
@@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/cons.h>
+#include <sys/ctype.h>
#include <sys/thread2.h>
#include <sys/spinlock2.h>
@@
-107,7
+108,12
@@
db_putchar(int c, void *arg)
* the message buffer.
*/
if (!db_active) {
- kprintf("%c", c);
+ if (c == '\r' || c == '\n' || c == '\t' ||
+ isprint(c)) {
+ kprintf("%c", c);
+ } else {
+ kprintf("?");
+ }
if (!db_active)
return;
if (c == '\r' || c == '\n')