X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=common%2Fkgdb.c;h=daf53bed7a9630133c659e0384307c480a8292b6;hb=1321aef8cd13d89d36e8cda8482b87fcea93994a;hp=9e3b64c379b9831fd891bf9973f668e6f16acf2d;hpb=9d62f20d0861ef87460d073dc189c851715b46ae;p=oweals%2Fu-boot.git diff --git a/common/kgdb.c b/common/kgdb.c index 9e3b64c379..daf53bed7a 100644 --- a/common/kgdb.c +++ b/common/kgdb.c @@ -103,7 +103,7 @@ static char remcomOutBuffer[BUFMAX]; static char remcomRegBuffer[BUFMAX]; static int initialized = 0; -static int kgdb_active = 0, first_entry = 1; +static int kgdb_active; static struct pt_regs entry_regs; static long error_jmp_buf[BUFMAX/2]; static int longjmp_on_fault = 0; @@ -326,7 +326,7 @@ handle_exception (struct pt_regs *regs) return (0); } - /* probably should check which exception occured as well */ + /* probably should check which exception occurred as well */ if (longjmp_on_fault) { longjmp_on_fault = 0; kgdb_longjmp(error_jmp_buf, KGDBERR_MEMFAULT); @@ -348,16 +348,7 @@ handle_exception (struct pt_regs *regs) kgdb_enter(regs, &kd); - if (first_entry) { - /* - * the first time we enter kgdb, we save the processor - * state so that we can return to the monitor if the - * remote end quits gdb (or at least, tells us to quit - * with the 'k' packet) - */ - entry_regs = *regs; - first_entry = 0; - } + entry_regs = *regs; ptr = remcomOutBuffer; @@ -459,7 +450,6 @@ handle_exception (struct pt_regs *regs) case 'k': /* kill the program, actually return to monitor */ kd.extype = KGDBEXIT_KILL; *regs = entry_regs; - first_entry = 1; goto doexit; case 'C': /* CSS continue with signal SS */ @@ -584,7 +574,7 @@ breakpoint(void) } int -do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +do_kgdb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { printf("Entering KGDB mode via exception handler...\n\n"); kgdb_breakpoint(argc - 1, argv + 1);