Difference between revisions of "Eclipse"

From eLinux.org
Jump to: navigation, search
m
(Plugins/Projects: fix plugin list)
Line 12: Line 12:
 
is really just a plugin framework.
 
is really just a plugin framework.
  
Eclipse is primarily geared to support Java development.  On Fedora 12, the default eclipse install
+
Eclipse is primarily geared to support Java development.  On Fedora 12, the default Eclipse installation
has support for writing java programs, but not C.
+
has support for writing Java programs, but not C. Support for developing in other languages, or in performing other development activities (e.g. launching other tools), is provided by plugins.
* JDT = Java Development tools - for Java development
+
 
 +
The following plugin project may be relevant for embedded Linux developers:
 +
* JDT = Java Development tools - for Java development (usually included with a default Eclipse installation)
 
* [http://www.eclipse.org/cdt/ CDT] = C/C++ Development tools - for C and C++ development
 
* [http://www.eclipse.org/cdt/ CDT] = C/C++ Development tools - for C and C++ development
 
* linuxtools = additional Linux-specific tools (like valgrind, lttng, oprofile, etc.)
 
* linuxtools = additional Linux-specific tools (like valgrind, lttng, oprofile, etc.)
** this is a superset of CDT
+
** This is a superset of CDT
* lttng - for performing tracing and analysis
+
** I haven't gotten this to work yet
+
 
* PDE = Plugin development environment
 
* PDE = Plugin development environment
 
** plugins to eclipse are written in java and use SWT
 
** plugins to eclipse are written in java and use SWT

Revision as of 23:48, 1 July 2011

Eclipse is a integrated development environment (IDE) which consists of a "plug-in framework" written in Java. See the Eclipse wikipedia entry.

Many embedded Linux vendors ship tools based on Eclipse, including TimeSys, MontaVista, Wind River Systems and LynuxWorks. Android uses Eclipse as it's main application development environment, and the Yocto Project also includes Eclipse support.

Eclipse started as an IDE for writing Java programs, but has been extended to support numerous other languages, and development activities.

Eclipse basics

Plugins/Projects

All real functionality in Eclipse is provided via plugins (themselves written Java). That is, Eclipse itself is really just a plugin framework.

Eclipse is primarily geared to support Java development. On Fedora 12, the default Eclipse installation has support for writing Java programs, but not C. Support for developing in other languages, or in performing other development activities (e.g. launching other tools), is provided by plugins.

The following plugin project may be relevant for embedded Linux developers:

  • JDT = Java Development tools - for Java development (usually included with a default Eclipse installation)
  • CDT = C/C++ Development tools - for C and C++ development
  • linuxtools = additional Linux-specific tools (like valgrind, lttng, oprofile, etc.)
    • This is a superset of CDT
  • PDE = Plugin development environment
  • PyDev = python development IDE
  • Target Management/Remote System Explorer (TM/RSE)
    • Is used to discover and manage targets
    • see http://www.eclipse.org/tm/
    • Is used by Wind River for their embedded Linux IDE product

Eclipse and Android

Eclipse is the main application development environment for Android.

To develop programs for Android, a developer installs a Java development kit (JDK), Eclipse itself, and the Android Platform Tools, which is an SDK with class libraries and target management tools (like fastboot and adb). Finally, the developer installs the Android Development Tools (ADT), which has plugins and add-ons for Eclipse.

  • Android Development Tools
    • Android Development Tools is installed as a plugin to Eclipse (using eclipse software manager)
  • Android SDK and AVD manager
    • window to control Android SDK component installs
      • can install or uninstall SDK parts (including different API class libs, examples, and tools)
    • windows to control AVD (QEMU sessions)
      • AVD = Android Virtual Device
      • AVD manager can:
        • define sessions
        • start sessions
      • A different window/dialog is used for selecting a target for deployment and debug
  • Underneath everything are command line tools
    • sometimes you have to use command line adb to "repair" something (uninstall an app on the target)
  • DDMS = Set of windows to show process information from Android
    • DDMS can also be run as a stand-alone application
      • This shows some system-wide information that the Eclipse version does not

Android development install process overview

  • install JDK
  • install eclipse
    • install JDT (inside eclipse, using the "install software" option)
  • install Android SDK
    • install platforms and platform tools (using Android SDK manager)
  • install ADT (using eclipse "install software" option)
    • configure ADT with path to Android SDK
  • can then create Android projects
    • select platform (library and class) version
    • can debug on target or on qemu
  • can also run DDMS
    • view more target-specific info
  • can run Android SDK and AVD manager
    • to create new AVDs or launch them, or to install/uninstall platforms (libraries and classes)

Android eclipse plugins

  • Source code for the Eclipse plugins for Android is in: <aosp_root>/sdk/eclipse/plugins
    • The following plugins are available:
      • com.android.ide.eclipse.adt
      • com.android.ide.eclipse.hierarchyviewer
      • com.android.ide.eclipse.tests
      • com.android.ide.eclipse.ddms
      • com.android.ide.eclipse.pdt
      • com.android.ide.eclipse.traceview

Eclipse and Yocto

Yocto has an eclipse

  • Yocto uses CDT remote launch, org.eclipse.cdt.launch.remote and TCF file/shells to transfer binaries and launch applications
  * CDT = (C Development Toolkit)
  * See: http://www.yoctoproject.org/projects/eclipse-ide-plug
  * supports communication with emulator or real device, via Yocto Eclipse TCF
  * emulated devices use NFS rootfs so host and target access same filesystem
  * debugging is via cross-gdb (gdbserver and gdb client on host)
  * CDT 7.0
  * RSE 3.2 (Remote System Explorer)
  * Autotools
  * Yocto Plug-in

The Yocto plug-in provides the following tools:

  • OProfile: Selecting this tool causes the oprofile-server to be launched on the remote machine. The oprofile-viewer must be installed on the local host machine and the oprofile-server must be installed on the remote target, respectively, in order to use. You can locate both the viewer and server from http://git.yoctoproject.org/cgit/cgit.cgi/oprofileui/. You need to compile and install the oprofile-viewer from the source code on your local host machine. The oprofile-server is installed by default in the image.
  • Lttng-ust: Selecting this tool runs "usttrace" on the remote target, transfers the output data back to the local host machine and uses "lttv-gui" to graphically display the output. The "lttv-gui" must be installed on the local host machine to use this tool. For information on how to use "lttng" to trace an application, see http://lttng.org/files/ust/manual/ust.html
  • PowerTOP: Selecting this tool runs "PowerTOP" on the remote target machine and displays the results in a new view called "powertop".
  • LatencyTOP and Perf: "LatencyTOP" identifies system latency, while "perf" monitors the system's performance counter registers. Selecting either of these tools causes an RSE terminal view to appear from which you can run the tools. Both tools refresh the entire screen to display results while they run.

Remote System Explorer

I downloaded RSE as part of the Yocto ADT, and found it easy to view files on a target that was running sshd. Also, it was easy to configure and launch shells and "terminals". Shells allow you run individual commands, and see their output. A terminal provides an interactive shell.

Usage examples and tutorials (relevant to Embedded Linux)

  • BeagleBoard Eclipse describes how to install and use Eclipse with BeagleBoard, focused on JTAG debugging.

Tips/Tricks

  • With CDT, the resource scanner can get into cycles with symbolic links of folders. You must set up a resource filter ignoring these links to prevent the memory leaks that result.

Miscellaneous Notes

  • Eclipse is a derivative of VisualAge by IBM (which was originally a smalltalk IDE)
  • Eclipse uses SWT graphics and windowing (not AWT or SWING)
    • AWT is too native, SWING is too non-native
    • SWT is supposed to be "just right" tradeoff between performance and look and feel.
  • can get Vim-like keybindings with vwrapper - http://vrapper.sourceforge.net/home/