diff --git a/nemu/src/monitor/sdb/addrexp.y b/nemu/src/monitor/sdb/addrexp.y index f429b18..0041088 100644 --- a/nemu/src/monitor/sdb/addrexp.y +++ b/nemu/src/monitor/sdb/addrexp.y @@ -25,7 +25,7 @@ expression | expression '+' expression { $$ = $1 + $3; } | expression '-' expression { $$ = $1 - $3; } | expression '*' expression { $$ = $1 * $3; } - | expression '/' expression { $$ = $1 / $3; if($3 == 0) perror("Devide by 0\n"); YYABORT; } + | expression '/' expression { $$ = $1 / $3; if($3 == 0) { perror("Devide by 0\n"); YYABORT; }} | '-' number { $$ = -$2; } | '(' expression ')' { $$ = $2; } diff --git a/nemu/src/monitor/sdb/sdb.c b/nemu/src/monitor/sdb/sdb.c index be1e25e..e68432b 100644 --- a/nemu/src/monitor/sdb/sdb.c +++ b/nemu/src/monitor/sdb/sdb.c @@ -205,7 +205,7 @@ static int cmd_x(char *args) { return 0; wrong_usage: - printf("Invalid argument for command x: %s\n", args); + printf("Invalid argument for command x: %s\n", arg); printf("Usage: x [N: uint] [EXPR: ]\n"); return 0; }