diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2010-05-20 21:04:24 -0500 |
---|---|---|
committer | Jason Wessel <jason.wessel@windriver.com> | 2010-05-20 21:04:24 -0500 |
commit | a0de055cf61338549b13079a5677ef2e1b6472ef (patch) | |
tree | 6191bbd6b3d567350b12ad973356995dbeffeeb3 /kernel/debug/kdb | |
parent | 6d45a1aed34b0cd7b298967eb9cb72b77afcb33b (diff) |
kgdb: gdb "monitor" -> kdb passthrough
One of the driving forces behind integrating another front end (kdb)
to the debug core is to allow front end commands to be accessible via
gdb's monitor command. It is true that you could write gdb macros to
get certain data, but you may want to just use gdb to access the
commands that are available in the kdb front end.
This patch implements the Rcmd gdb stub packet. In gdb you access
this with the "monitor" command. For instance you could type "monitor
help", "monitor lsmod" or "monitor ps A" etc...
There is no error checking or command restrictions on what you can and
cannot access at this point. Doing something like trying to set
breakpoints with the monitor command is going to cause nothing but
problems. Perhaps in the future only the commands that are actually
known to work with the gdb monitor command will be available.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Diffstat (limited to 'kernel/debug/kdb')
-rw-r--r-- | kernel/debug/kdb/kdb_io.c | 13 | ||||
-rw-r--r-- | kernel/debug/kdb/kdb_private.h | 1 |
2 files changed, 9 insertions, 5 deletions
diff --git a/kernel/debug/kdb/kdb_io.c b/kernel/debug/kdb/kdb_io.c index 9e3cec7a925..8339b291e8b 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; diff --git a/kernel/debug/kdb/kdb_private.h b/kernel/debug/kdb/kdb_private.h index 69ed2eff3fe..97d3ba69775 100644 --- a/kernel/debug/kdb/kdb_private.h +++ b/kernel/debug/kdb/kdb_private.h @@ -254,7 +254,6 @@ extern unsigned long kdb_task_state(const struct task_struct *p, unsigned long mask); extern void kdb_ps_suppressed(void); extern void kdb_ps1(const struct task_struct *p); -extern int kdb_parse(const char *cmdstr); extern void kdb_print_nameval(const char *name, unsigned long val); extern void kdb_send_sig_info(struct task_struct *p, struct siginfo *info); extern void kdb_meminfo_proc_show(void); |