diff --git a/nemu/src/monitor/elf.c b/nemu/src/monitor/elf.c index 3497cf5..17d5f33 100644 --- a/nemu/src/monitor/elf.c +++ b/nemu/src/monitor/elf.c @@ -100,7 +100,7 @@ void init_elf(const char* elf_file) { // filling ftrace assert(pstrt != NULL && pstrt != NULL); for (int i = 0; i < symt_sz; i ++) { - if (ELF_ST_TYPE(psymt[i].st_info) & STT_FUNC) { + if (ELF_ST_TYPE(psymt[i].st_info) == STT_FUNC) { // Warning due to elf_ftrace is global variable so you don't need to set '\0' in the end // strncpy(elf_ftrace[elf_ftrace_size].fname, pstrt + psymt[i].st_name, // sizeof(elf_ftrace[0].fname) - 1);