Fixed a typo; dbg_init2() called dbg_init() instead of arch_dbg_init(), causing
many kernel debugger commands to be removed accidently... Added a message if you entered an unknown command. Some cleanups. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@758 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
c65ac9cbe8
commit
6057f25bc6
@ -113,10 +113,9 @@ debug_read_line(char *buf, int max_len)
|
||||
history_line = cur_history_spot + 1;
|
||||
if(history_line >= HISTORY_SIZE)
|
||||
history_line = 0;
|
||||
} else {
|
||||
} else
|
||||
break; // nothing to do here
|
||||
}
|
||||
}
|
||||
|
||||
// dprintf("2c %d h %d ch %d\n", cur_line, history_line, cur_history_spot);
|
||||
|
||||
@ -174,9 +173,8 @@ debug_parse_line(char *buf, char **argv, int *argc, int max_args)
|
||||
if (!isspace(parse_line[0])) {
|
||||
argv[0] = parse_line;
|
||||
*argc = 1;
|
||||
} else {
|
||||
} else
|
||||
*argc = 0;
|
||||
}
|
||||
|
||||
while (parse_line[pos] != '\0') {
|
||||
if (isspace(parse_line[pos])) {
|
||||
@ -227,6 +225,9 @@ kernel_debugger_loop()
|
||||
}
|
||||
cmd = cmd->next;
|
||||
}
|
||||
if (cmd == NULL)
|
||||
dprintf("unknown command, enter \"help\" to get a list of all supported commands\n");
|
||||
|
||||
cur_line++;
|
||||
if (cur_line >= HISTORY_SIZE)
|
||||
cur_line = 0;
|
||||
@ -378,14 +379,14 @@ remove_debugger_command(const char * name, int (*func)(int, char **))
|
||||
break;
|
||||
prev = cmd;
|
||||
cmd = cmd->next;
|
||||
};
|
||||
}
|
||||
|
||||
if (cmd) {
|
||||
if (cmd == commands)
|
||||
commands = cmd->next;
|
||||
else
|
||||
prev->next = cmd->next;
|
||||
};
|
||||
}
|
||||
|
||||
release_spinlock(&dbg_spinlock);
|
||||
restore_interrupts(flags);
|
||||
@ -393,7 +394,7 @@ remove_debugger_command(const char * name, int (*func)(int, char **))
|
||||
if (cmd) {
|
||||
kfree(cmd);
|
||||
return B_NO_ERROR;
|
||||
};
|
||||
}
|
||||
|
||||
return B_NAME_NOT_FOUND;
|
||||
}
|
||||
@ -439,9 +440,7 @@ dbg_init2(kernel_args *ka)
|
||||
add_debugger_command("reboot", &cmd_reboot, "Reboot");
|
||||
add_debugger_command("gdb", &cmd_gdb, "Connect to remote gdb");
|
||||
|
||||
dbg_init(ka);
|
||||
|
||||
return B_NO_ERROR;
|
||||
return arch_dbg_init(ka);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user