diff --git a/nemu/Kconfig b/nemu/Kconfig index 9865104..268d702 100644 --- a/nemu/Kconfig +++ b/nemu/Kconfig @@ -7,6 +7,11 @@ menu "NEMU Configuration Options" help Say Y here if you want to enable watchpoint functionality. This will add performance overhead but is useful for debugging. + config CONFIG_LOG_EXPR + bool "Enable make_token Log" + default n + help + Say Y here if you want to enable match rules Log endmenu choice diff --git a/nemu/src/cpu/cpu-exec.c b/nemu/src/cpu/cpu-exec.c index 5651c22..93b3de3 100644 --- a/nemu/src/cpu/cpu-exec.c +++ b/nemu/src/cpu/cpu-exec.c @@ -43,7 +43,6 @@ static void trace_and_difftest(Decode *_this, vaddr_t dnpc) { bool wp_check_hit(void); if (wp_check_hit()) { printf("watchpoint hit\n"); - isa_reg_display(); nemu_state.state = NEMU_STOP; } #endif diff --git a/nemu/src/monitor/sdb/expr.c b/nemu/src/monitor/sdb/expr.c index c2257e2..ac1da4e 100644 --- a/nemu/src/monitor/sdb/expr.c +++ b/nemu/src/monitor/sdb/expr.c @@ -102,8 +102,10 @@ static bool make_token(char *e) { char *substr_start = e + position; int substr_len = pmatch.rm_eo; +#ifdef CONFIG_CONFIG_LOG_EXPR Log("match rules[%d] = \"%s\" at position %d with len %d: %.*s", i, rules[i].regex, position, substr_len, substr_len, substr_start); +#endif position += substr_len; diff --git a/nemu/src/monitor/sdb/watchpoint.c b/nemu/src/monitor/sdb/watchpoint.c index e8cec07..b70ce79 100644 --- a/nemu/src/monitor/sdb/watchpoint.c +++ b/nemu/src/monitor/sdb/watchpoint.c @@ -78,6 +78,7 @@ void show_wp() { printf("No. Expr\n"); for (WP* tmp = head; tmp != NULL; tmp = tmp->next) { printf("%3d: %12s = "FMT_WORD"\n", tmp->NO, tmp->expr, tmp->val); + tmp->hit = false; } }