From 2c2e7d9de351a4797a6a33b913fdf3e580b302c4 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Fri, 21 Feb 2025 02:37:48 +0200 Subject: [PATCH] build(userspace): update vscode launch configuration and Makefiles for utest and libc_test Easier to debug Signed-off-by: EnderIce2 --- .vscode/launch.json | 7 ++++++- Userspace/apps/test/libc_test/Makefile | 2 +- Userspace/apps/test/utest/Makefile | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 144cec6c..e5725554 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -48,7 +48,12 @@ }, { "text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/utest", - "description": "Load /bin/utest", + "description": "/bin/utest (0x00400000)", + "ignoreFailures": true + }, + { + "text": "add-symbol-file ${workspaceFolder}/../initrd_tmp_data/bin/libc_test", + "description": "/bin/libc_test (0x00600000)", "ignoreFailures": true }, { diff --git a/Userspace/apps/test/libc_test/Makefile b/Userspace/apps/test/libc_test/Makefile index 97f559be..c8942269 100644 --- a/Userspace/apps/test/libc_test/Makefile +++ b/Userspace/apps/test/libc_test/Makefile @@ -14,7 +14,7 @@ build: $(FILENAME).elf cp $(FILENAME).elf $(WORKSPACE_DIR)/out/bin/$(FILENAME) # Use static linking -LDFLAGS += -static -fno-pic -fno-pie -Wl,-static +LDFLAGS += -static -fno-pic -fno-pie -Wl,-static -Wl,-Ttext=0x00600000 CFLAGS += -ggdb3 -O0 -g -fdiagnostics-color=always # Use default toolchain if not specified diff --git a/Userspace/apps/test/utest/Makefile b/Userspace/apps/test/utest/Makefile index 65e9b387..13dee6ab 100644 --- a/Userspace/apps/test/utest/Makefile +++ b/Userspace/apps/test/utest/Makefile @@ -11,14 +11,14 @@ FILENAME = $(notdir $(shell pwd)) WARNCFLAG = -Wall -Wextra build: $(FILENAME).elf -# cp $(FILENAME).elf $(WORKSPACE_DIR)/out/bin/$(FILENAME) + cp $(FILENAME).elf $(WORKSPACE_DIR)/out/bin/$(FILENAME) # Use static linking LDFLAGS += -static -fno-pic -fno-pie -Wl,-static $(FILENAME).elf: $(OBJ) $(info Linking $@) -# $(CC) $(LDFLAGS) $(SYSROOT) $(OBJ) -o $@ + $(CC) $(LDFLAGS) $(SYSROOT) $(OBJ) -o $@ %.o: %.c $(HEADERS) $(info Compiling $<)