Commit e916beab authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb:
  sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function
  debug_core,kdb: fix kgdb_connected bit set in the wrong place
  Fix merge regression from external kdb to upstream kdb
  repair gdbstub to match the gdbserial protocol specification
  kdb: break out of kdb_ll() when command is terminated
parents 4c0c03ca edd63cb6
...@@ -493,7 +493,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p) ...@@ -493,7 +493,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p)
sysrq_key_table[i] = op_p; sysrq_key_table[i] = op_p;
} }
static void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) void __handle_sysrq(int key, struct tty_struct *tty, int check_mask)
{ {
struct sysrq_key_op *op_p; struct sysrq_key_op *op_p;
int orig_log_level; int orig_log_level;
......
...@@ -45,6 +45,7 @@ struct sysrq_key_op { ...@@ -45,6 +45,7 @@ struct sysrq_key_op {
*/ */
void handle_sysrq(int key, struct tty_struct *tty); void handle_sysrq(int key, struct tty_struct *tty);
void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
int register_sysrq_key(int key, struct sysrq_key_op *op); int register_sysrq_key(int key, struct sysrq_key_op *op);
int unregister_sysrq_key(int key, struct sysrq_key_op *op); int unregister_sysrq_key(int key, struct sysrq_key_op *op);
struct sysrq_key_op *__sysrq_get_key_op(int key); struct sysrq_key_op *__sysrq_get_key_op(int key);
......
...@@ -605,13 +605,13 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs) ...@@ -605,13 +605,13 @@ static int kgdb_cpu_enter(struct kgdb_state *ks, struct pt_regs *regs)
if (dbg_kdb_mode) { if (dbg_kdb_mode) {
kgdb_connected = 1; kgdb_connected = 1;
error = kdb_stub(ks); error = kdb_stub(ks);
kgdb_connected = 0;
} else { } else {
error = gdb_serial_stub(ks); error = gdb_serial_stub(ks);
} }
if (error == DBG_PASS_EVENT) { if (error == DBG_PASS_EVENT) {
dbg_kdb_mode = !dbg_kdb_mode; dbg_kdb_mode = !dbg_kdb_mode;
kgdb_connected = 0;
} else if (error == DBG_SWITCH_CPU_EVENT) { } else if (error == DBG_SWITCH_CPU_EVENT) {
dbg_cpu_switch(cpu, dbg_switch_cpu); dbg_cpu_switch(cpu, dbg_switch_cpu);
goto cpu_loop; goto cpu_loop;
......
...@@ -621,10 +621,8 @@ static void gdb_cmd_query(struct kgdb_state *ks) ...@@ -621,10 +621,8 @@ static void gdb_cmd_query(struct kgdb_state *ks)
switch (remcom_in_buffer[1]) { switch (remcom_in_buffer[1]) {
case 's': case 's':
case 'f': case 'f':
if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10)) { if (memcmp(remcom_in_buffer + 2, "ThreadInfo", 10))
error_packet(remcom_out_buffer, -EINVAL);
break; break;
}
i = 0; i = 0;
remcom_out_buffer[0] = 'm'; remcom_out_buffer[0] = 'm';
...@@ -665,10 +663,9 @@ static void gdb_cmd_query(struct kgdb_state *ks) ...@@ -665,10 +663,9 @@ static void gdb_cmd_query(struct kgdb_state *ks)
pack_threadid(remcom_out_buffer + 2, thref); pack_threadid(remcom_out_buffer + 2, thref);
break; break;
case 'T': case 'T':
if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16)) { if (memcmp(remcom_in_buffer + 1, "ThreadExtraInfo,", 16))
error_packet(remcom_out_buffer, -EINVAL);
break; break;
}
ks->threadid = 0; ks->threadid = 0;
ptr = remcom_in_buffer + 17; ptr = remcom_in_buffer + 17;
kgdb_hex2long(&ptr, &ks->threadid); kgdb_hex2long(&ptr, &ks->threadid);
......
...@@ -1820,9 +1820,8 @@ static int kdb_sr(int argc, const char **argv) ...@@ -1820,9 +1820,8 @@ static int kdb_sr(int argc, const char **argv)
{ {
if (argc != 1) if (argc != 1)
return KDB_ARGCOUNT; return KDB_ARGCOUNT;
sysrq_toggle_support(1);
kdb_trap_printk++; kdb_trap_printk++;
handle_sysrq(*argv[1], NULL); __handle_sysrq(*argv[1], NULL, 0);
kdb_trap_printk--; kdb_trap_printk--;
return 0; return 0;
...@@ -1883,6 +1882,7 @@ static int kdb_lsmod(int argc, const char **argv) ...@@ -1883,6 +1882,7 @@ static int kdb_lsmod(int argc, const char **argv)
kdb_printf(" (Loading)"); kdb_printf(" (Loading)");
else else
kdb_printf(" (Live)"); kdb_printf(" (Live)");
kdb_printf(" 0x%p", mod->module_core);
#ifdef CONFIG_MODULE_UNLOAD #ifdef CONFIG_MODULE_UNLOAD
{ {
...@@ -2291,6 +2291,9 @@ static int kdb_ll(int argc, const char **argv) ...@@ -2291,6 +2291,9 @@ static int kdb_ll(int argc, const char **argv)
while (va) { while (va) {
char buf[80]; char buf[80];
if (KDB_FLAG(CMD_INTERRUPT))
return 0;
sprintf(buf, "%s " kdb_machreg_fmt "\n", command, va); sprintf(buf, "%s " kdb_machreg_fmt "\n", command, va);
diag = kdb_parse(buf); diag = kdb_parse(buf);
if (diag) if (diag)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment