Maybe you had this problem too: you shared a project with somebody, only to realize that your carefully crafted debug configuration was not shared?
Eclipse has the concept to store settings in the ‘framework’. The ‘framework’ is the Eclipse internal data, basically what is inside the .metadata folder of the workspace.
If I create a debug configuration for a project, then by default Eclipse stores it in the ‘framework’ (workspace data). This means that the debug configuration is *not* stored in the project settings: If I zip that project or share it with a version control system, then the debug configuration is *not* shared. In order to share the debug configuration, it needs to be stored in a physical file.
Sharing Debug Configuration File
For this, I need to enable ‘Shared file’ in the ‘Common’ tab of the debug configuration:
If I have multiple debug connections for my project, then the settings for each are stored in a separate .launch file:
If now I share the project, and that project gets opened with the .launch files, then the debug configurations will show up. 🙂
Summary
To share debug (or launch) configurations with my project, then I need to enable ‘Shared file’ in the configuration: that way the configuration gets stored in a file inside the project.
Happy Sharing 🙂
Thanks for the usefull information!
LikeLike
Sometimes the simple things are the most useful ones 🙂
LikeLike
A note of caution for those using this interesting feature (already documented in the plug-ins documentation: gnuarmeclipse.livius.net/blog/jlink-debugging/): be sure you do not enter absolute paths in the debugging configuration, otherwise the shared files will not be portable.
In order to make portability easier, I just applied a small change to the debug plug-ins, to set the working directory of the gdb server and gdb client processes to the project folder. This will allow to use relative paths to configuration files stored in the project folder. This feature will be available in the next release.
LikeLike
Hi Liviu,
I did not specify an absolute path. Or are you saying an absolute path was used inside? What is currently the working directory of the gdb server/client process? The path where the executable is?
LikeLike
Thanks a lot, I always wondered if there was a way to do that since I use 3 different computers, at work and at home and a notebook when on the go.
LikeLike
Yes, the CodeWarrior project had that enabled by default, but not my Eclipse Kepler ones. Until I have found out that this is the option behind the scenes which makes sharable launch configuration possible.
LikeLike
Yeah, I don’t use CodeWarrior 🙂
LikeLike
Thanks for this post, I didn’t know that sharing a debug configuration was possible.
LikeLike
Yes, I have not realized that setting for a long time too, until I needed it desperately…
LikeLike
Pingback: Preserving Memory Ranges with Eclipse and P&E GDB Server | MCU on Eclipse
Pingback: Tips for Making Copy of Eclipse CDT Projects Easier | MCU on Eclipse
Pingback: Eclipse JTAG Debugging the ESP32 with a SEGGER J-Link | MCU on Eclipse
Pingback: OpenOCD with MCU-Link | MCU on Eclipse