Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196343
b: refs/heads/master
c: a0de055
h: refs/heads/master
i:
  196341: 473b08f
  196339: c4ca9da
  196335: 4520f81
v: v3
  • Loading branch information
Jason Wessel committed May 21, 2010
1 parent 5330519 commit 6dabed7
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d45a1aed34b0cd7b298967eb9cb72b77afcb33b
refs/heads/master: a0de055cf61338549b13079a5677ef2e1b6472ef
2 changes: 1 addition & 1 deletion trunk/kernel/debug/debug_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static int kgdb_use_con;
int dbg_switch_cpu;

/* Use kdb or gdbserver mode */
static int dbg_kdb_mode = 1;
int dbg_kdb_mode = 1;

static int __init opt_kgdb_con(char *str)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/debug/debug_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ extern void gdbstub_msg_write(const char *s, int len);

/* gdbstub functions used for kdb <-> gdbstub transition */
extern int gdbstub_state(struct kgdb_state *ks, char *cmd);
extern int dbg_kdb_mode;

#ifdef CONFIG_KGDB_KDB
extern int kdb_stub(struct kgdb_state *ks);
extern int kdb_parse(const char *cmdstr);
#else /* ! CONFIG_KGDB_KDB */
static inline int kdb_stub(struct kgdb_state *ks)
{
Expand Down
22 changes: 22 additions & 0 deletions trunk/kernel/debug/gdbstub.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ void gdbstub_msg_write(const char *s, int len)
int wcount;
int i;

if (len == 0)
len = strlen(s);

/* 'O'utput */
gdbmsgbuf[0] = 'O';

Expand Down Expand Up @@ -685,6 +688,25 @@ static void gdb_cmd_query(struct kgdb_state *ks)
kgdb_mem2hex(tmpstr, remcom_out_buffer, strlen(tmpstr));
}
break;
#ifdef CONFIG_KGDB_KDB
case 'R':
if (strncmp(remcom_in_buffer, "qRcmd,", 6) == 0) {
int len = strlen(remcom_in_buffer + 6);

if ((len % 2) != 0) {
strcpy(remcom_out_buffer, "E01");
break;
}
kgdb_hex2mem(remcom_in_buffer + 6,
remcom_out_buffer, len);
len = len / 2;
remcom_out_buffer[len++] = 0;

kdb_parse(remcom_out_buffer);
strcpy(remcom_out_buffer, "OK");
}
break;
#endif
}
}

Expand Down
13 changes: 9 additions & 4 deletions trunk/kernel/debug/kdb/kdb_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -669,10 +670,14 @@ int kdb_printf(const char *fmt, ...)
* 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;
Expand Down
1 change: 0 additions & 1 deletion trunk/kernel/debug/kdb/kdb_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6dabed7

Please sign in to comment.