From 04874462c184aaf7038e806072fa16a2fa480f17 Mon Sep 17 00:00:00 2001 From: Yongmao Luo Date: Tue, 4 Jun 2024 12:22:17 +0800 Subject: [PATCH] mica: change the path in debugging info to be relative Previously, we compile the "micad" on compilation machine, and copy it to the host machine for debugging. On host machine, the path to the MCS source code is different from the path on compilation machine. The absolute path is hard for us to debug, because the GDB will find the source code according to the path containing the absolute path. Thus, replace the path to source code with relative path, and use the "directory" command in GDB to define the path to MCS repo on host machine, so that the "list" command can list the source code correctly. Signed-off-by: Yongmao Luo --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75f2c00..fdb4593 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ project(openeuler_mica) ## set common FLAGS set(CMAKE_SHARED_LINKER_FLAGS "-pthread") set(CMAKE_C_FLAGS "-fstack-protector-all -O2 -Wall") -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -fdebug-prefix-map=${CMAKE_CURRENT_SOURCE_DIR}=.") ## Add dependencies set(SHARED_LINK_LIBS -- Gitee