aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/debug
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/debug')
-rw-r--r--kernel/debug/gdbstub.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/debug/gdbstub.c b/kernel/debug/gdbstub.c
index 4ef9dddf4588..fc7b174c4718 100644
--- a/kernel/debug/gdbstub.c
+++ b/kernel/debug/gdbstub.c
@@ -604,6 +604,7 @@ static void gdb_cmd_reg_set(struct kgdb_state *ks)
604{ 604{
605 unsigned long regnum; 605 unsigned long regnum;
606 char *ptr = &remcom_in_buffer[1]; 606 char *ptr = &remcom_in_buffer[1];
607 int i = 0;
607 608
608 kgdb_hex2long(&ptr, &regnum); 609 kgdb_hex2long(&ptr, &regnum);
609 if (*ptr++ != '=' || 610 if (*ptr++ != '=' ||
@@ -612,7 +613,14 @@ static void gdb_cmd_reg_set(struct kgdb_state *ks)
612 error_packet(remcom_out_buffer, -EINVAL); 613 error_packet(remcom_out_buffer, -EINVAL);
613 return; 614 return;
614 } 615 }
615 kgdb_hex2mem(ptr, (char *)gdb_regs, dbg_reg_def[regnum].size); 616 memset(gdb_regs, 0, sizeof(gdb_regs));
617 while (i < sizeof(gdb_regs) * 2)
618 if (hex_to_bin(ptr[i]) >= 0)
619 i++;
620 else
621 break;
622 i = i / 2;
623 kgdb_hex2mem(ptr, (char *)gdb_regs, i);
616 dbg_set_reg(regnum, gdb_regs, ks->linux_regs); 624 dbg_set_reg(regnum, gdb_regs, ks->linux_regs);
617 strcpy(remcom_out_buffer, "OK"); 625 strcpy(remcom_out_buffer, "OK");
618} 626}