diff --git a/LICENSE.txt b/LICENSE.txt index ffe4849..d5a757c 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -3,9 +3,12 @@ Copyright License ========================================================================== The PKE software is: -Copyright (c) 2021, Zhiyuan Shao (zyshao@hust.edu.cn), - Yi Gui (gy163email@163.com), - Yan Jiao (773709579@qq.com), +Copyright (c) 2021, Zhiyuan Shao (zyshao@hust.edu.cn), + Yi Gui (gy163email@163.com), + Ziming Yuan (1223962053@qq.com), + Yixin Song (yixinsong@hust.edu.cn), + Boyang Li (liboyang_hust@163.com), + Zichen Xu (xuzichen@hust.edu.cn), Huazhong University of Science and Technology Permission is hereby granted, free of charge, to any person obtaining diff --git a/Makefile b/Makefile index 5ed973d..4edd2a4 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ ifneq (,) mabi := -mabi=$(if $(is_32bit),ilp32,lp64) endif -CFLAGS := -Wall -Werror -fno-builtin -nostdlib -D__NO_INLINE__ -mcmodel=medany -g -Og -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE $(march) +CFLAGS := -Wall -Werror -fno-builtin -nostdlib -D__NO_INLINE__ -mcmodel=medany -g -Og -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -fno-PIE $(march) -fno-omit-frame-pointer COMPILE := $(CC) -MMD -MP $(CFLAGS) $(SPROJS_INCLUDE) #--------------------- utils ----------------------- @@ -71,7 +71,7 @@ USER_OBJS := $(addprefix $(OBJ_DIR)/, $(patsubst %.c,%.o,$(USER_CPPS))) -USER_TARGET := $(OBJ_DIR)/app_long_loop +USER_TARGET := $(OBJ_DIR)/app_print_backtrace #------------------------targets------------------------ $(OBJ_DIR): @-mkdir -p $(OBJ_DIR) diff --git a/user/app_long_loop.c b/user/app_long_loop.c deleted file mode 100644 index 8b4d873..0000000 --- a/user/app_long_loop.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Below is the given application for lab1_3. - * This app performs a long loop, during which, timers are - * generated and pop messages to our screen. - */ - -#include "user_lib.h" -#include "util/types.h" - -int main(void) { - printu("Hello world!\n"); - int i; - for (i = 0; i < 100000000; ++i) { - if (i % 5000000 == 0) printu("wait %d\n", i); - } - - exit(0); - - return 0; -} diff --git a/user/app_print_backtrace.c b/user/app_print_backtrace.c new file mode 100644 index 0000000..588cfb5 --- /dev/null +++ b/user/app_print_backtrace.c @@ -0,0 +1,23 @@ +/* + * Below is the given application for lab1_challenge1_backtrace. + * This app prints all functions before calling print_backtrace(). + */ + +#include "user_lib.h" +#include "util/types.h" + +void f8() { print_backtrace(7); } +void f7() { f8(); } +void f6() { f7(); } +void f5() { f6(); } +void f4() { f5(); } +void f3() { f4(); } +void f2() { f3(); } +void f1() { f2(); } + +int main(void) { + printu("back trace the user app in the following:\n"); + f1(); + exit(0); + return 0; +}