Difference between revisions of "ECE497 Notes on Installing the Eclipse IDE"

From eLinux.org
Jump to: navigation, search
(Work in Progress)
Line 6: Line 6:
  
 
Here's how to run gdb on Beagle via Eclipse
 
Here's how to run gdb on Beagle via Eclipse
I'm doing this for Galileo which was released just yesterday (24-June-2009).  apt-get eclipse doesn't get the newest version yet.
 
  
 +
== Installing ==
  
== Downloading ==
+
Install and the gdb tools
 
 
Go to http://www.eclipse.org/downloads/ and download
 
"Eclipse IDE for C/C++ Developers (79 MB)"
 
I'm doing this for 32-bit Linux so I used:
 
http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/galileo/R/eclipse-cpp-galileo-linux-gtk.tar.gz
 
 
 
Let the archive manager open it.  It takes a minute or so to download.
 
Click Extract and put it in your favorite place.
 
 
 
 
=== Java ===
 
 
 
Before running Eclipse on Ubuntu you need to download java.
 
There appears to be several you can download.  I picked:
 
sudo apt-get install openjdk-6-jre-headless
 
 
 
once installed, open eclipse by
 
<pre>
 
cd eclipse
 
./eclipse
 
</pre>
 
 
 
I like to put the workspace folder in the eclipse folder.  Put yours whereever you would like it.
 
 
 
 
== gdb-cross debugger ==
 
 
 
While we're at it let's install the cross debugger
 
 
<pre>
 
<pre>
cd ~/oe
+
$ cd ~/oe
. beagleboard/beagleboard/profile.sh
+
$ sudo  apt-get install eclipse
bitbake gbd-cross
+
$ source source-me.txt
 +
$ bitbake gbd-cross
 
</pre>
 
</pre>
 
  
 
== Install Remote System Tools ==
 
== Install Remote System Tools ==
  
Go to Help:Install New Software...
+
In Eclispe
Click the down arrow to the right of "type or select a site" and
+
# Go to Help:Install New Software...
Select: Galileo - http://download.eclipse.org/releases/galileo
+
# Click the down arrow to the right of "type or select a site" and
Expand: Programming Languages
+
# Select: Galileo - http://download.eclipse.org/releases/galileo
Eclipse C/C++ Development should already be installed, if not, check it.
+
# Expand: Programming Languages
Expand: Modile and Device Development
+
# Eclipse C/C++ Development should already be installed, if not, check it.
Eclipse C/C++ DSF gdb Debugger should already be installed, if not, check it.
+
# Expand: Modile and Device Development
Check: Eclipse C/C++ Remote Launch
+
# Eclipse C/C++ DSF gdb Debugger should already be installed, if not, check it.
Check: Remote System Explorer End-User Runtime
+
# Check: Eclipse C/C++ Remote Launch
Check: Remote System Explorer User Actions
+
# Check: Remote System Explorer End-User Runtime
Click: Next >
+
# Check: Remote System Explorer User Actions
Click: Finish
+
# Click: Next >
Click "Yes" to restart eclipse
+
# Verify the list and Click Next >
Click: "Yes" to use same workspace
+
# Accept the license and Click: Finish
 
+
# Click "Yes" to restart eclipse
 +
# Click: "Yes" to use same workspace
  
 
== Finding the Beagle's IP address ==
 
== Finding the Beagle's IP address ==
  
#On the BeagleBoard run ifconfig eth0.  Note the IP address
+
# On the BeagleBoard run ifconfig eth0.  Note the IP address
#On the host edit /etc/hosts and add:
+
# On the host edit <code>/etc/hosts</code> and add:
137.112.41.76 Beagle
+
137.112.41.76 Beagle (Use your IP address)
#(Use your IP address)
+
# Exit the editor and try:
#Exit the editor and try:
+
<pre>
 
ping Beagle
 
ping Beagle
 +
</pre>
 
# If you don't get an answer something is messed up.
 
# If you don't get an answer something is messed up.
 
# On the host connect to the Beagle and create a workspace
 
# On the host connect to the Beagle and create a workspace

Revision as of 11:25, 31 March 2010


Work in Progress

Eclipse is an open source Integrated Development Environment that's enjoying broad use.

Here's how to run gdb on Beagle via Eclipse

Installing

Install and the gdb tools

$ cd ~/oe
$ sudo  apt-get install eclipse 
$ source source-me.txt
$ bitbake gbd-cross

Install Remote System Tools

In Eclispe

  1. Go to Help:Install New Software...
  2. Click the down arrow to the right of "type or select a site" and
  3. Select: Galileo - http://download.eclipse.org/releases/galileo
  4. Expand: Programming Languages
  5. Eclipse C/C++ Development should already be installed, if not, check it.
  6. Expand: Modile and Device Development
  7. Eclipse C/C++ DSF gdb Debugger should already be installed, if not, check it.
  8. Check: Eclipse C/C++ Remote Launch
  9. Check: Remote System Explorer End-User Runtime
  10. Check: Remote System Explorer User Actions
  11. Click: Next >
  12. Verify the list and Click Next >
  13. Accept the license and Click: Finish
  14. Click "Yes" to restart eclipse
  15. Click: "Yes" to use same workspace

Finding the Beagle's IP address

  1. On the BeagleBoard run ifconfig eth0. Note the IP address
  2. On the host edit /etc/hosts and add:
137.112.41.76	Beagle (Use your IP address)
  1. Exit the editor and try:
ping Beagle
  1. If you don't get an answer something is messed up.
  2. On the host connect to the Beagle and create a workspace

ssh Beagle mkdir workspace/HelloWorld/Debug

Now back to the host


Setting up for remote debugging

Select: Project:Properties Expand: C/C++ Build Select: Settings Tab: Tool Settings Select: GCC C Compiler Replace "gcc" in "Command:" with "~/oe/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-gcc" Click: Directories (below GCC C Compiler Click Add... button and insert ~/oe/tmp/staging/armv7a-angstrom-linux-gnueabi/user/include ~/oe/ Click: GCC C Linker (below Directories) Replace "gcc" in "Command:" with "~/oe/tmp/cross/armv7a/bin/arm-angstrom-linux-gnueabi-gcc" Click: Libraries Click: Add... to Library search path (-L) (the bottom one) insert: ~/oe/tmp/staging/armv7a-angstrom-linux-gnueabi/lib Click OK to close Properties for HelloWorld window

Hit Ctrl-B to build, or click the little hammer

Menu: Run:Debug Configurations... Double-Click C/C++ Remote Applcation to create a new configuration Name it BeagleBoard Project: Click Browse and select HelloWorld C/C++ Application: Click Search Project and select HelloWorld Remote Absolute File Path... Click: Browse... Connection: Click New... Select: SSH Only and Click Next > Host name: Beagle Click: Finish "Select Remote C/C++" will appear. Connection: Beagle Expand: My Home, workspace, HelloWorld, Debug Click: OK In the Properties window select Connection: Beagle Click: Apply Tab: Debugger GDB debugger: Click: Browse and look for ~/oe/tmp/cross/armv7a/bin/arm-angstrom-linux/gnueabi-g In Debugger Options Tab: Shared Libraries Add... ~/oe/tmp/staging/armv7a-angstgrom-linux-gnueabi/lib

Click: Debug (bottom right) It should compile your file (if needed), copy it to the Beagle and start gdb on it. It will run up to main() and wait for your input. Try the single step button (F6 step over, F5 step into)

Be sure to hit Terminal (Ctrl-F2) when done.

Add a for loop and watch the index variable change!


Other

This is taken from: http://www.ibm.com/developerworks/opensource/library/os-eclipse-stlcdt/index.html

You might be able to do this via apt-get install. I used the add/remove program app in Red Hat and selected Fedora Eclipse. It appears to load lots of things. This load version 3.4.1

In Ubuntu go to Applications: Add/Remove Select Show: All available applications Search: eclipse Check: Eclipse Click: Apply Changes Wait for some 113 files to download (15 minutes on a fast connection) With this install you need to load a few more things. Go to Help:Software Updates:Find and Install... Select: Search for new features to install Select: Callisto Discovery Site Click: Finish (wait a moment) Select a site near you (wait a moment) Expand: Callisto Discovery Site Select: C and C++ Development Next, Accept, Next, Finish (wait)

This loads version 3.2.2


        1. Install the c/c++ stuff

Select: Help:Software Updates Tab: Available Software Expand: Ganymede Update Site Check: C and C++ Development Click: Install Expand: Remote Access and Device Developement Check: Remote System Explorer C/C++ Remote Debugger Launcher Check: Remote System Explorer End-User Runtime Click: Install Click: Next Click: I accept... Click: Finish

          1. Fedora #####

I did see the Canymede Update Site on Fedora, so I Select: Help:Software Updates Tab: Available Software Click: Add Site Location: http://download.eclipse.org/releases/ganymede Click: OK The Available Software list should update nad "Ganymede Update Site" should appear. The follow the instructions above.

          1. #####

Start Eclipse Select: File:New:Project... Expand: C Select: C Project Click: Next Project Name: HelloWorld (no spaces) Select: Hello World ANSI C Project Click: Next Fill in to suit, Click: Next Click: Finish Tab: C/C++ Projects Expand: HelloWorld Expand: src Expand: HelloWorld.c Double-Click: main(void) The file will open in a window

This will create an executable that runs on the Ubuntu Linux (guest) platform.

          1. Beagle Execution

Here's how to run it remotely on the Beagle. This is from: http://www.nabble.com/Solution:-Using-Eclipse-CDT-for-Gusmtix-development-td18251552.html Here's what I did differently: 4) Project Properties/Settings

* On "GCC C++ Compiler" change "Command" to 

"~/gumstix/gumstix-oe/tmp/cross/bin/arm-angstrom-linux-gnueabi-g++" (dbg_03.png)

* On "GCC C++ Compiler/Directories" add 

"~/gumstix/gumstix-oe/tmp/staging/arm-angstrom-linux-gnueabi/include" to "Includes paths (-I)"

I used: tmp/staging/arm-angstrom-linux-gnueabi/usr/include

* On "GCC C++ Compiler/Miscellaneous" add "-c -march=armv5te 

-mtune=xscale -Wa,-mcpu=xscale" to "Other flags"

I didn't change this since the gcc should have all this set.

5) On "Run/Debug Configurations" add "C++ Remote Application"

* On "Main" tab

This is in Run:Debug Configurations


In eclipse, Select: Window:Open Perspective:C/C++ Click on the HelloWorld project to select it Select: Project:Properties Expand: C/C++ Build Select: Discovery Options


Starting point: http://www.nabble.com/Solution:-Using-Eclipse-CDT-for-Gusmtix-development-td18251552.html

On the Beagle: opkg install openssh openssh-sftp openssh-server opkg install gdbserver

In Eclipse File:New Project Select General:Project I used project name "Remove gdb"