2020-09-18 09:42 AM
Hi,
I'm building my project inside a Docker container that has STM32CubeIDE installed using the command:
headless-build.sh -build demo-nucleo-f334r8 -importAll /app
The project builds fine, and I'm able to successfully flash my board with the generated images. However, when I try to run a debug session on my Host machine (OSX and Windows 10) with the generated .elf file(from the Docker build) I get the following error
"Can't find a source file at "/app/Debug/../Core/Src/main.c" "
I tried using the -fdebug-prefix-map flag as follows:
-fdebug-prefix-map=$(@D)=.
to strip away the Docker directory prefix, however this does not seem to be having any effect.
Is there a way to use a debug image built inside a docker container with a debug session on the host machine?
Note: If I build my project inside a docker container using arm-none-eabi-gcc v9.3.1 and include the -fdebug-prefix-map flag in my Makefile, I'm able to run arm-none-eabi-gbd with the generated .elf image on my host machine and debug as normal, so I know the flag works with arm-none-eabi-gcc, I just can't get it to work with the STM32CUBEIde. Thank you!
best,
Akbar
Solved! Go to Solution.
2020-09-18 11:54 AM
I figured it out. I was being a little too fancy with my automatic variables. The flag should be:
-fdebug-prefix-map=/app=.
Note: /app is where I mount the project from my host computer into the docker container. For users mounting it in a different location, you would need to change the mapping.
2020-09-18 11:54 AM
I figured it out. I was being a little too fancy with my automatic variables. The flag should be:
-fdebug-prefix-map=/app=.
Note: /app is where I mount the project from my host computer into the docker container. For users mounting it in a different location, you would need to change the mapping.