> compile NEMU
ysyx_22040000 李心杨 Linux calcite 6.1.75 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan 25 23:27:52 UTC 2024 x86_64 GNU/Linux 22:16:25 up 4:17, 2 users, load average: 0.55, 0.29, 0.26
This commit is contained in:
parent
80c13c3f6b
commit
4a78296ebd
6 changed files with 13 additions and 35 deletions
|
@ -21,7 +21,7 @@
|
|||
#include <cpu/cpu.h>
|
||||
#include <errno.h>
|
||||
#include <isa.h>
|
||||
#include <memory/paddr.h>
|
||||
#include <memory/vaddr.h>
|
||||
#include <readline/history.h>
|
||||
#include <readline/readline.h>
|
||||
#include <stdint.h>
|
||||
|
@ -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;
|
||||
|
||||
|
|
|
@ -18,20 +18,4 @@
|
|||
|
||||
#include <common.h>
|
||||
|
||||
// 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
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue