From 6f21a70234926e1a87f0798b0841d0a32c03c159 Mon Sep 17 00:00:00 2001 From: tracer-ics2023 Date: Sun, 1 Sep 2024 16:21:58 +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:21:58=20up=201=20day,?= =?UTF-8?q?=2015:12,=20=201=20user,=20=20load=20average:=200.38,=200.31,?= =?UTF-8?q?=200.18?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nemu/src/monitor/sdb/watchpoint.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nemu/src/monitor/sdb/watchpoint.c b/nemu/src/monitor/sdb/watchpoint.c index 7b3dee0..e8cec07 100644 --- a/nemu/src/monitor/sdb/watchpoint.c +++ b/nemu/src/monitor/sdb/watchpoint.c @@ -61,11 +61,11 @@ bool wp_check_hit(void) { return res; } -static WP* del_wp(WP* head, WP* pos) { - for (WP** i = &head; (*i) != NULL && (*i)->next != NULL; i = (WP**)*i) { +static WP* del_wp(WP** head, WP* pos) { + for (WP** i = head; (*i) != NULL && (*i)->next != NULL; i = (WP**)*i) { if ((**i).NO == pos->NO) { WP* res = *i; - *i = (**i).next; + *i = (*i)->next; return res; } } @@ -87,7 +87,7 @@ WP* new_wp(char* _expr, int len) { if (!success) { return NULL; } - WP* wp = del_wp(free_, free_); + WP* wp = del_wp(&free_, free_); if (wp == NULL) { assert(0); } @@ -108,7 +108,7 @@ WP* get_wp(int NO) { } void free_wp(WP *_wp) { - WP* wp = del_wp(head, _wp); + WP* wp = del_wp(&head, _wp); wp->next = free_; free_ = wp; wp->expr[0] = '\0';