summaryrefslogtreecommitdiffstats
path: root/kernel/debug/kdb/kdb_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/debug/kdb/kdb_io.c')
-rw-r--r--kernel/debug/kdb/kdb_io.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c
index 9e3cec7a925c..8339b291e8bc 100644
--- a/kernel/debug/kdb/kdb_io.c
+++ b/kernel/debug/kdb/kdb_io.c
@@ -21,6 +21,7 @@
#include <linux/smp.h>
#include <linux/nmi.h>
#include <linux/delay.h>
+#include <linux/kgdb.h>
#include <linux/kdb.h>
#include <linux/kallsyms.h>
#include "kdb_private.h"
@@ -669,10 +670,14 @@ kdb_printit:
* Write to all consoles.
*/
retlen = strlen(kdb_buffer);
- while (c) {
- c->write(c, kdb_buffer, retlen);
- touch_nmi_watchdog();
- c = c->next;
+ if (!dbg_kdb_mode && kgdb_connected) {
+ gdbstub_msg_write(kdb_buffer, retlen);
+ } else {
+ while (c) {
+ c->write(c, kdb_buffer, retlen);
+ touch_nmi_watchdog();
+ c = c->next;
+ }
}
if (logging) {
saved_loglevel = console_loglevel;