I'm building my c/c++ application for arm controllers with gcc in a docker. There together with the .hex and .bin file also the .elf file is generated. Once generated they all are exported out from the container to the host machine. Now I would like to debug the application with openocd, arm-none-eabi-gdb and eclipse cdt. I'm able to start debug session on the target board, but when I stop the debugger (or it stops on its on at startup on main) it is not able to find the source files to show:
Can't find a source file at "/usr/src/Testbench/LIBS/Shell/shell.c"
The path here is the one of the build project in the docker container and has nothing to do with the new debug project on the host where all files are located now. I tried to edit source lookup path in eclipse with no luck, I could find the file an then it worked for just that file. Also specifying the folders did not work. Anyway, doing it manually always for all files/folders in the project is not an option.
The solution should be "scripted" since all this is part of a CI/devops concept.
It seems that the "wrong" path is hard coded in the elf file. Is there a (scripted) way to change that path to match the actual project location so that eclipse and gdb just work as expected and the developper can see the debug info when debugging?
Possibly it should work on Linux and Windows ;-)
Thanks in advance for your help
Martin
Now it works! In eclipse in the debug configuration in the gdb commands I added :
Then I had to go to the source lookup path in eclipse and remove everything.