Below, automations are suggested in order to maximize the productivity when maintaining projects using Eclipse. At first external Tools invocations are suggested, and then actions associated with run/debug.
Finally, import (and export) of these configuration settings are discussed.
As a preparatory step, it makes sense to define some variables which define the target IP-address as well as the path of the distribution sources. Open window→Preferences, and treat the settings below as an example for your environment:
Creating the uClinux dist involves two steps: make xconfig (for configuration - make menuconfig isn't possible, since it requires a standard terminal, not the terminal window in Eclipse) and make (for building). Instead of executing these commands from a bash session they may be run from Eclipse if desired. When you plan to mainly use eclipse for application program testing you'll have no need to enter tool entries for these configuration invocations. Here, an example of a tool entry creation is presented, following a table of other entries that can be useful.
First select Run>External Tools>External Tools. The External Tools dialog should now be displayed:
In the pane on the left, select Program then click on the New button.
A new configuration should now be created.
In the Name field enter a name for this configuration.
In the Location field enter the location of the program make (usually /usr/bin/make).
In the Working Directory field enter the path of the uClinux distribution. Note that our predefined variable is used here.
In the Arguments field enter xconfig.
Please uncheck the build before launch checkbox (tab build), since this will mostly be executed before and under the tab Common you can decide about launching in the background or not. This must be unchecked for tool entries that will be included in the build process (see below).
Click the Apply button.
Similarly, you can create other tool entries as listed on the left pane of the dialog shown here. A sample of a complete configuration is appended here as a downloadable file, which can be imported. Refer to the screenshot below the table.
A short explanation of the proposed tool entries:
| Entry | explanation |
|---|---|
| configuration (Kernel) | This invokes the GUI-based kernel configuration. Location: /usr/bin/makeWorking Directory: ${uClinux_dist_path}/linux-2.6.xArguments: xconfig |
| configuration (Main) | This invokes the GUI-based toplevel configuration. (does not work with xconfig) Working Directory: ${uClinux_dist_path}Location: /usr/bin/makeArguments: qconfig |
| configuration (Userland) | This invokes the configuration of all sort of things beyond the kernel. Working Directory: ${uClinux_dist_path}/Location: /usr/bin/makeArguments: config_qconfig |
| ELF load to target | Loads the executable at the desired target location. Location: /usr/bin/rcpWorking Directory: ${project_loc}/DebugArguments: test root@${targetIP}:test |
| gdbserver + app start | Using rsh, this will start the application under gdbserver control without opening an interactive shell. However, printf output will appear in the bottom line Console view of Eclipse. You may treat it as a comfortable feature, but alas, any printf output is flushed to the console view after the program is terminated (see separate discussion page). When printf output must appear onto a target device, gdbserver must be started from the target console or use the tip hereafter. Location: /usr/bin/rshArguments: -l root ${targetIP} gdbserver localhost:3333 ./testHere add ”>” /dev/console if printf() output be local (see also discussion page). |
| Make all | This needs no explanation. Feel free to add more make tool entries if felt comfortable. |
Finally click the Close button.
In order not to have to invoke too many tools in a build process, desired tools can be invoked automatically while building.
To do this first select your project in the Navigator view then choose Project>Properties. The Properties dialog should now be displayed (ignore the dependencies entry):
From the list on the left select Builders. Two entries are already present.
Click on the Import button and select the tool action to add, ELF to target. The actions are executed in list order. Consider yourself if any tool should not execute in “background” - if a subsequent action requires the result of any previous one. If you plan to start the target gdbserver too, you can add this action here, too.
A directory called .externalToolBuilders will be created in your project. This directory contains files with information about the build tools. You should now be able to build the uClinux memory image simply by selecting Project→Build All or Project>Build Project.
While the project is being built the output from the compiler/make can be seen in the console view. This view is usually located near the bottom of the workspace. If this view is not visible it can be enabled by selecting Window→Show View→Other→Basic→Console.
For older versions of Eclipse, you can use the Zylin plugin as described below. For newer versions (3.4+), this should no longer be required. The following steps are for Eclipse Helios (3.6).
Click on the Debugger tab. Enter the IP address of your Linux target and the port number that you used when you launched GDB server.
Click Debug to launch your debug configuration.
Below a Debug configuration is shown using the Zylin plugin facility. The standard entry “C/C++ Local Application work as well. The Zylin plugin offers the advantage of being able to exactly specify gdb's initial actions as shown in the screenshot.
Alas, it is not possible to use variables here, as is possible with the external Tools configuration.
Invoke the import menu via File→Import and select the entry shown below:
Click Next and then select the path where the configuration resides in the dialog that appears. In this case the path is entered that is default upon Export. Find a sample file just below. You may make a partial selection of import items.
Note that the right pane shows import entities from both Tools entries and Run/Debug entries.