#include <kgdb.h>
#include <command.h>
-#if (CONFIG_COMMANDS & CFG_CMD_KGDB)
-
#undef KGDB_DEBUG
/*
static int initialized = 0;
static int kgdb_active = 0, first_entry = 1;
static struct pt_regs entry_regs;
-static u_int error_jmp_buf[BUFMAX/2];
+static long error_jmp_buf[BUFMAX/2];
static int longjmp_on_fault = 0;
#ifdef KGDB_DEBUG
static int kdebug = 1;
}
*buf = 0;
longjmp_on_fault = 0;
- return buf;
+ return (unsigned char *)buf;
}
/* convert the hex array pointed to by buf into binary to be placed in mem
/* probably should check which exception occured as well */
if (longjmp_on_fault) {
longjmp_on_fault = 0;
- kgdb_longjmp((long*)error_jmp_buf, KGDBERR_MEMFAULT);
+ kgdb_longjmp(error_jmp_buf, KGDBERR_MEMFAULT);
panic("kgdb longjump failed!\n");
}
printf("kgdb: handle_exception; trap [0x%x]\n", kgdb_trap(regs));
- if (kgdb_setjmp((long*)error_jmp_buf) != 0)
+ if (kgdb_setjmp(error_jmp_buf) != 0)
panic("kgdb: error or fault in entry init!\n");
kgdb_enter(regs, &kd);
*ptr++ = hexchars[rp->num >> 4];
*ptr++ = hexchars[rp->num & 0xf];
*ptr++ = ':';
- ptr = mem2hex((char *)&rp->val, ptr, 4);
+ ptr = (char *)mem2hex((char *)&rp->val, ptr, 4);
*ptr++ = ';';
}
printf("kgdb: remcomOutBuffer: %s\n", remcomOutBuffer);
#endif
- putpacket(remcomOutBuffer);
+ putpacket((unsigned char *)&remcomOutBuffer);
while (1) {
volatile int errnum;
printf("kgdb: remcomInBuffer: %s\n", remcomInBuffer);
#endif
- errnum = kgdb_setjmp((long*)error_jmp_buf);
+ errnum = kgdb_setjmp(error_jmp_buf);
if (errnum == 0) switch (remcomInBuffer[0]) {
#endif
/* reply to the request */
- putpacket(remcomOutBuffer);
+ putpacket((unsigned char *)&remcomOutBuffer);
} /* while(1) */
}
kgdb_error(int errnum)
{
longjmp_on_fault = 0;
- kgdb_longjmp((long*)error_jmp_buf, errnum);
+ kgdb_longjmp(error_jmp_buf, errnum);
panic("kgdb_error: longjmp failed!\n");
}
buffer[0] = 'O';
mem2hex ((char *)s, &buffer[1], count);
- putpacket(buffer);
+ putpacket((unsigned char *)&buffer);
return 1;
}
}
U_BOOT_CMD(
- kgdb, CFG_MAXARGS, 1, do_kgdb,
- "kgdb - enter gdb remote debug mode\n",
+ kgdb, CONFIG_SYS_MAXARGS, 1, do_kgdb,
+ "enter gdb remote debug mode",
"[arg0 arg1 .. argN]\n"
" - executes a breakpoint so that kgdb mode is\n"
" entered via the exception handler. To return\n"
" program if it is executed (see the \"hello_world\"\n"
" example program in the U-Boot examples directory)."
);
-#else
-
-int kgdb_not_configured = 1;
-
-#endif /* CFG_CMD_KGDB */