From 4a78296ebdc8602a1f773ef2d061588dbe4cb1e4 Mon Sep 17 00:00:00 2001 From: tracer-ysyx Date: Mon, 5 Feb 2024 22:16:25 +0800 Subject: [PATCH] =?UTF-8?q?>=20compile=20NEMU=20ysyx=5F22040000=20?= =?UTF-8?q?=E6=9D=8E=E5=BF=83=E6=9D=A8=20Linux=20calcite=206.1.75=20#1-Nix?= =?UTF-8?q?OS=20SMP=20PREEMPT=5FDYNAMIC=20Thu=20Jan=2025=2023:27:52=20UTC?= =?UTF-8?q?=202024=20x86=5F64=20GNU/Linux=20=2022:16:25=20=20up=20=20=204:?= =?UTF-8?q?17,=20=202=20users,=20=20load=20average:=200.55,=200.29,=200.26?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nemu/.metals/metals.log | 3 +++ nemu/.metals/metals.mv.db | Bin 0 -> 20480 bytes nemu/.vscode/settings.json | 5 ++++- nemu/src/monitor/sdb/sdb.c | 16 ++++++---------- nemu/src/monitor/sdb/sdb.h | 16 ---------------- nemu/src/monitor/sdb/watchpoint.c | 8 -------- 6 files changed, 13 insertions(+), 35 deletions(-) create mode 100644 nemu/.metals/metals.log create mode 100644 nemu/.metals/metals.mv.db diff --git a/nemu/.metals/metals.log b/nemu/.metals/metals.log new file mode 100644 index 0000000..6c3b991 --- /dev/null +++ b/nemu/.metals/metals.log @@ -0,0 +1,3 @@ +2024.02.03 20:20:12 INFO Started: Metals version 1.2.0+12-644090c2-SNAPSHOT in folders '/home/xin/repo/ysyx-workbench/nemu' for client Visual Studio Code 1.85.2. +2024.02.03 20:20:13 WARN Build server is not auto-connectable. +2024.02.03 20:20:13 WARN no build tool detected in workspace '/home/xin/repo/ysyx-workbench/nemu'. The most common cause for this problem is that the editor was opened in the wrong working directory, for example if you use sbt then the workspace directory should contain build.sbt.  diff --git a/nemu/.metals/metals.mv.db b/nemu/.metals/metals.mv.db new file mode 100644 index 0000000000000000000000000000000000000000..634be79529b1958cb915363d37b0066bf0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lmZ{GAkM+=C4W@KVG zGu9eT0EB$e1+2hGp8KCOtic@2pt&p{ywlkLl}}l4{y-o>yh)HG30S{L5RBu_x=D~9 z{{HyMS(v103jn@6_clo$C+3_o!=Qvk35OCMB?3w^D9NHkM2UnF10@ZVm?*JOVxy$# z5=I1A+I_|%sw{qpsIrJEE4cMJ_Z#IiZa(XNi|)7New&%L0nruiGL_Eazg_UG9-F#m z@8-PtgVc4SmGj~rP_xapW#34Plbhi%2)CIRx{&ozW8hyO+@&)FIn)l3W4wQd7-_dB zJuVDA6yFixlfTDyLYQ_adL%GD_!o>xa>4N>)8#ou4>)`TtIt0^EKg|~J^0%Vo}EgM zouY>zJrpM6A0InK503sIT4n-0#3zIXO_7V_1lLSxhfvLig7vsu*eUV^K7rGqT;^O{ z>;7SaMVrVj4(pk~E*d7sPHs1etRJS_6tM=>fdiTXd`=as8<-T}^MpIhown7fbgraF z_0I)gkB) zTo9%8MTfJrXX^r`OrRwBODq>C34xO6FL89B#0E;jAs_XOzaXLl7REuh8dAp~52AE+ zoF3INYKo>Krj80su!P5e-|>huT*4#5B|IWjVi|u;HtQ!B=#u07udflqmgWyIhXOwIu_Ixl!$V&N9r~OQQs<#_=!2-9$y`nhD;+)U z4Ov55OeezBcc$WL=S=19P~jZK-^-cm0-UJ|u+xOp* #include #include -#include +#include #include #include #include @@ -125,17 +125,13 @@ static word_t parse_uint(const char *arg, bool *success) { } } -static paddr_t parse_expr(const char *arg, bool *success) { +static vaddr_t parse_expr(const char *arg, bool *success) { if (arg == NULL) { puts("Invalid expr argument."); *success = false; return 0; } else { - // bool res = false; - // FIXME: We cannot use `parse_uint` here, it accept `-1234` as input - // paddr_t addr = parse_uint(arg, &res); - // *success = res; - paddr_t addr; + vaddr_t addr; yy_scan_string(arg); *success = !yyparse(&addr); yylex_destroy(); @@ -197,11 +193,11 @@ static int cmd_x(char *args) { if (!res) goto wrong_usage; addr = addr & ~(WORD_BYTES - 1); - for (paddr_t paddr = addr; paddr < addr + n; paddr += WORD_BYTES) { - word_t value = paddr_read(addr, WORD_BYTES); + for (vaddr_t vaddr = addr; vaddr < addr + n; vaddr += WORD_BYTES) { + word_t value = vaddr_read(addr, WORD_BYTES); printf("\e[1;34m" FMT_PADDR "\e[0m" " " FMT_WORD "\n", - paddr, value); + vaddr, value); } return 0; diff --git a/nemu/src/monitor/sdb/sdb.h b/nemu/src/monitor/sdb/sdb.h index b1c87de..e94846c 100644 --- a/nemu/src/monitor/sdb/sdb.h +++ b/nemu/src/monitor/sdb/sdb.h @@ -18,20 +18,4 @@ #include -// TODO: Cache expression evalutation result in ExprResult -enum ExprType { - EXPR_TYPE_MEM_ADDR, - EXPR_TYPE_REG -}; - -union ExprValue { - word_t addr; - word_t *reg; -}; - -typedef struct ExprResult { - union ExprValue val; - enum ExprType type; -} ExprResult; - #endif diff --git a/nemu/src/monitor/sdb/watchpoint.c b/nemu/src/monitor/sdb/watchpoint.c index d6440d3..2618bba 100644 --- a/nemu/src/monitor/sdb/watchpoint.c +++ b/nemu/src/monitor/sdb/watchpoint.c @@ -97,12 +97,4 @@ int wp_remove_by_number(int number) { return 0; } -int wp_eval_all() { - WP *wp; - for (wp = head; wp != NULL; wp = wp->next) { - - } - return 0; -} - /* TODO: Implement the functionality of watchpoint */