提交 74fc8604 编写于 作者: Z Zihao Yu

Merge branch 'fix-debugfmt' into 'master'

Fix debugfmt

See merge request projectn/noop!68
......@@ -28,16 +28,16 @@ void set_abort(void) {
int display_trapinfo(uint64_t max_cycles) {
switch (g_trapCode) {
case STATE_GOODTRAP:
eprintf(ANSI_COLOR_GREEN "HIT GOOD TRAP at pc = 0x%" PRIu64 "\n" ANSI_COLOR_RESET, g_trapPC);
eprintf(ANSI_COLOR_GREEN "HIT GOOD TRAP at pc = 0x%" PRIx64 "\n" ANSI_COLOR_RESET, g_trapPC);
break;
case STATE_BADTRAP:
eprintf(ANSI_COLOR_RED "HIT BAD TRAP at pc = 0x%" PRIu64 "\n" ANSI_COLOR_RESET, g_trapPC);
eprintf(ANSI_COLOR_RED "HIT BAD TRAP at pc = 0x%" PRIx64 "\n" ANSI_COLOR_RESET, g_trapPC);
break;
case STATE_ABORT:
eprintf(ANSI_COLOR_RED "ABORT at pc = 0x%" PRIu64 "\n" ANSI_COLOR_RESET, g_trapPC);
eprintf(ANSI_COLOR_RED "ABORT at pc = 0x%" PRIx64 "\n" ANSI_COLOR_RESET, g_trapPC);
break;
case STATE_RUNNING:
eprintf(ANSI_COLOR_RED "Timeout after %" PRIu64 " cycles\n" ANSI_COLOR_RESET, max_cycles);
eprintf(ANSI_COLOR_RED "Timeout after %" PRIx64 " cycles\n" ANSI_COLOR_RESET, max_cycles);
break;
}
......
......@@ -18,7 +18,10 @@ void sd_read(uint32_t *data) {
void init_sd(void) {
fp = fopen("/home/yzh/projectn/debian.img", "r");
assert(fp);
if(!fp)
{
eprintf(ANSI_COLOR_MAGENTA "[warning] sdcard img not found\n");
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册