Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22202

ELF replace WSL-path to Windows-Path (GCC / ARM / CortexM)

$
0
0

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.

  1. 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.

  1. 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

Viewing all articles
Browse latest Browse all 22202

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>