...
Start Eclipse and select a workspace directory, different from the directory where your source file is located.
To create an empty project, open File -> New -> C/C++ Project, select ะก Managed Build and click Next.
In C Project window enter a name of the project, for example,
c-example
, select Empty Project -> Cross GCC and click Finish.On this step you are prompted to choose build configurations. Click Next to proceed with the default settings.
In the Cross GCC Command dialog, enter
arm-buildroot-uclinuxfdpiceabi-
in the Cross compiler prefix box and/usr/local/arm-buildroot-uclinuxfdpiceabi_sdk-buildroot/bin
in Cross compiler path, click Finish.Develop source files for whatever application user would like to debug on the uClinux target. For instance:
Code Block $ vi app.c #include <stdio.h> int func(int a, int b) { int c = (a+b)/2; printf("%s: (%d + %d)/2 = %d\n", __func__, a, b, c); return c; } int main() { int a, b, ret; a = 10; b = 20; ret = func(a,b); printf("%s: got result %d\n", __func__, ret); return 0; }
To add the source file to the project, open File -> Import. In the Import dialog select General -> File System, click Next.
Click Browse and navigate to the directory where the source file is located (
/home/sasha/work
in the example below), then select the directory in the left window.Click Finish to complete.
...
On the host filesystem, the executable binaries are located in the Debug
subfolder of the Eclipse workspace directory:
Code Block |
---|
% $ ls -1 eclipse-workspace/c-example/Debug/
app.d
app.o
c-example
makefile
sources.mk
subdir.mk
$ |
...