diff --git a/nemu/src/monitor/sdb/addrexp.l b/nemu/src/monitor/sdb/addrexp.l index 9d6b263..6882a0b 100644 --- a/nemu/src/monitor/sdb/addrexp.l +++ b/nemu/src/monitor/sdb/addrexp.l @@ -2,6 +2,7 @@ #include #include static bool success = false; + void yyerror(word_t *result, const char *err); %} %option noyywrap @@ -10,7 +11,7 @@ $[a-zA-Z]{2,3} { yylval = isa_reg_str2val(yytext + 1, &success); if(!success) { - printf("YYTEXT: %s", yytext); + yyerror(NULL, "Failed to convert reg to value"); return YYerror; } } diff --git a/nemu/tests/expr_test.c b/nemu/tests/expr_test.c index 0042372..18f8435 100644 --- a/nemu/tests/expr_test.c +++ b/nemu/tests/expr_test.c @@ -219,7 +219,7 @@ int main(void) { s = expr_suite(); sr = srunner_create(s); - srunner_run_all(sr, CK_VERBOSE); + srunner_run_all(sr, CK_NORMAL); number_failed = srunner_ntests_failed(sr); srunner_free(sr);