Fix warnings in kern/debug.c

This commit is contained in:
Ali Mashtizadeh 2014-07-13 14:48:41 -07:00
parent b553da4d10
commit 4cb35eee1c

View File

@ -146,11 +146,15 @@ void
Debug_Dump(int argc, const char *argv[])
{
uint64_t off, len;
if (argc == 3)
if (argc != 3)
{
off = Debug_SymbolToInt(argv[1]);
len = Debug_SymbolToInt(argv[2]);
kprintf("Dump requires 3 arguments\n");
return;
}
off = Debug_SymbolToInt(argv[1]);
len = Debug_SymbolToInt(argv[2]);
kprintf("Dump 0x%llx 0x%llx\n", off, len);
Debug_PrintHex((const char *)off, len, 0, len);
}
@ -185,13 +189,13 @@ Debug_Prompt()
// execute command
if (strcmp(argv[0], "help") == 0) {
Debug_Help(argc, argv);
Debug_Help(argc, (const char **)argv);
} else if (strcmp(argv[0], "dump") == 0) {
Debug_Dump(argc, argv);
Debug_Dump(argc, (const char **)argv);
} else if (strcmp(argv[0], "registers") == 0) {
Debug_Registers(argc, argv);
Debug_Registers(argc, (const char **)argv);
} else if (strcmp(argv[0], "echo") == 0) {
Debug_Echo(argc, argv);
Debug_Echo(argc, (const char **)argv);
} else if (strcmp(argv[0], "") != 0) {
kprintf("Unknown command '%s'\n", argv[0]);
}