Handle $stop and $finish at the interactive prompt.

This patch adds interactive support for $stop and $finish.
$stop displays a message that the simulator is already stopped.
$finish acts exactly like (calls) the interactive "finish"
command. Having $stop do nothing and $finish not finish until
you exit interactive mode is not very intuitive.
This commit is contained in:
Cary R 2009-04-10 15:36:07 -07:00 committed by Stephen Williams
parent ad604253f2
commit 1ef6c405c3
1 changed files with 7 additions and 2 deletions

View File

@ -457,8 +457,13 @@ static void invoke_command(char*txt)
if (argc > 0) {
if (argv[0][0] == '$') {
cmd_call(argc, argv);
if (strcmp(argv[0], "$stop") == 0) {
printf("The simulator is already stopped!\n");
} else if (strcmp(argv[0], "$finish") == 0){
cmd_finish(argc, argv);
} else {
cmd_call(argc, argv);
}
} else {
unsigned idx;
for (idx = 0 ; cmd_table[idx].name ; idx += 1)