If you build a cortexM firmware on linux (WSL in this case), the resulting *.elf file for debugging will carry "nix" paths, example:
/home/user/project//home/user/project/Src/main.c/home/user/project/Inc/home/user/project/Inc/Legacy/home/user/project/FreeRTOS/task.c
Im looking for a solution to replace those paths inside the ELF file automatically as the project is too large to do it by hand every time.
Tried GDB Command "set substitute-path"
set substitute-path /home/user/project D:\workspace\project\
set substitute-path /home/user/project D:\\workspace\\project\\
Both cases did not work.
Tried GCC build and link Command:
"-fdebug-prefix-map=/home/user/project=D:\workspace\project"
"-fdebug-prefix-map=/home/user/project=D:\\workspace\\project\\"
Both (1) and (2) did not work, as it seems it just replaces the beginning of a file path but then leaves the remaining path untouched, eg
D:\workspace\project\Src/main.c