From ed96ef2811d550c13c359bfd31b942f732c1ec18 Mon Sep 17 00:00:00 2001 From: tracer-ics2023 Date: Sun, 1 Sep 2024 16:26:42 +0800 Subject: [PATCH] =?UTF-8?q?>=20=20compile=20NEMU=20221220000=20=E5=BC=A0?= =?UTF-8?q?=E4=B8=89=20Linux=20zzy=205.15.146.1-microsoft-standard-WSL2=20?= =?UTF-8?q?#1=20SMP=20Thu=20Jan=2011=2004:09:03=20UTC=202024=20x86=5F64=20?= =?UTF-8?q?x86=5F64=20x86=5F64=20GNU/Linux=20=2016:26:41=20up=201=20day,?= =?UTF-8?q?=2015:16,=20=201=20user,=20=20load=20average:=200.99,=200.51,?= =?UTF-8?q?=200.28?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nemu/Kconfig | 5 +++++ nemu/src/cpu/cpu-exec.c | 1 - nemu/src/monitor/sdb/expr.c | 2 ++ nemu/src/monitor/sdb/watchpoint.c | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) 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; } }