Friday, October 20, 2006

Import existing project



Setting up and running a project under Eclipse is quite awkward. Unless you really need an environment that looks and behaves the same on various host I'd recomend you to use Kdevelop instead (it's much faster). Check out the guide at: http://tinker-kde.blogspot.com/

Eclipse however has the advantage of running and looking the same on Windows, Linux or any host you have a working set of cross tools and a working Java interpreter for.

Thursday, October 19, 2006

Define where it is


Unselect "Use default" and enter the search-path to your project.

Wednesday, October 18, 2006

Make settings - Builder


If your application exists a bit further down in the projects structure, make sure to change the "build directory" accordingly.

Tuesday, October 17, 2006

Make settings - Find the build directory


Eclipse makes it easy to find the build-directory. Just choose "browse" from the dialog above and find it...

Monday, October 16, 2006

First build



Before you build for the first time, you should have configured both the kernel and your application. This is easiest to do from command line (read the README in the source distribution how that's done).

Now build the application. Keep an eye on the output and make sure the cross-tools you intended to use are really the ones used. In the example above we can verify it's the arm-hix-elf tool-chain thats been used... (this might look slightly different if you use another target tool-chain).

Advice: I usually deselect the "Build automatically"

Sunday, October 15, 2006

Setting up the debugger


Create a new debug profile in "Create, manage, and run configurations". Choose "C/C++ local application" and press new.

Fill in the options in the "main" tab as in the picture above.

Saturday, October 14, 2006

Setting the GDB wrapper


If you want to take advantage of the projects work-around for debugging your application in ROM/Flash, find and select the script "gdb-wrapper.exp" in the "GDB debugger" setting. The script is part of the "multisys" sample project.

Unfortunately, Eclipse expects this particular setting to be an absolute path. This means you have change this setting if you move your project around ;( (I.e. an Eclipse project that stands under CVS or any other SCM will need this to be adjusted when it's checked out or updated).

The "GDB command file" can however be relative. Find the gdb.cfg if you need to connect to a remote GDB server (which you most likely do).

Friday, October 13, 2006

Start up a debug session


Click "Apply" in the dialog above to start the debug session. It might take a while (10 seconds is quite normal for a fairly standard laptop).

If everything works as it should, you'll get the above view up. Notice that the the debugger takes you to the first line of "C"-code (which is in the kernel itself).

Note: Make sure the application is downloaded to the target and that any GDB backend stuff is set up and in order first. Try using the projects build supports for downloading: ' make flashit'

Thursday, October 12, 2006

Debug


Find your application-code and set a break-point somewhere. Notice how we set the breakpoint in a thread. When the execution stops, you can inspect the variables local to the thread just as if it would be a singel threaded application.

A nice feature of Eclipse is that if you position the mouse over any variable, Eclipse will automatically ask the target for the value and present it in a "thumb-note".