简体   繁体   中英

Eclipse is not able to find sources during debug

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 :

set substitute-path /usr/src/ ${workspace_loc}

Then I had to go to the source lookup path in eclipse and remove everything.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM