Eclipse tutorial for CSE465

Garrett Eardley

Start up:

1.  Open Eclipse

2.  Specify Workspace that does not have "spaces" in the path

Creating new Project:

1.  Click file->new Project

2.  Find managed make C and click next

3.  Type in a project name and click next

4.  Specify Project Type: Executable (sparc-elf toolchain, bare sparc-elf with minimal i/o)

Creating a source file:

1.  File -> new source file

2.  Specify the source file name. ***IMPORTANT*** you must put the correct file extension and the end of the file name.

Creating a header file:

1.  Same as creating a source file but you click on new header file instead

Configuring Project:

1.  Right click on the project folder and select properties

2.  Click on C/C++ BUILD

3.  Specify configuration: Debug

4.  Click apply

Configuring to run grmon:

1.  Click on run->external tools-> external tools ...

2.  Click on Default GRMON launch

3.  Change executable to "grmon-eval"

4.  Change working directory to your current workspace

  1. Click on browse workspace
  2. Click on your project and select the debug folder
  3. Click OK

5.  Change arguments to "-i -u -uart //./com2"

6.  Click apply

7.  Click close

Configuring debug tools:

1.  Click on run->debug...

2.  Double click on C/C++ Application running on TSIM2/GRMON

3.  Cick on your project name

4.  Specify the application to debug

  1. Click on search project
  2. Select the the executable that is in the debug folder

5.  Click on the Grmon tab

6.  Specify Default GRMON launch

7.  Click on the Debugger tab

8.  Specify the sparc-elf GDB Debugger

9.  Click apply

10.  Click close

To run debugger:

*** Make sure your bit file has been loaded onto the board

1.  Click on run->debug-<Project Name>

How to change perspectives:

1.  Click on Window->Open Perspective -> other..

2.  Click on the perspective you want

3.  Click on OK

Using the debugger

* Make sure you are the debug perspective

In the debug perspective there are the following default windows with their uses described below

·  debug - defaults to the upper left window. The following buttons are active:

o  run - continues running the program until a breakpoint is reached

o  pause - pause the program

o  stop - terminates the run of the program and will disconnect from grmon. Also clears the debug window.

o  Restart - goes back to the beginning of the program

o  step into - execute highlighted instruction and steps into function calls

o  step over - execute the highligted instruction and does not step into functions

·  data window - defaults to the upper right window - -has the following default tabs

·  variables - shows the values of the variables of the current function. You can right click on the variable and change its value.

·  Breakpoints - Shows all the breakpoints in your code.

·  Expressions - You can specify different expressions and view their value as the program progresses

·  Modules - Displays all the symbols of your assembly.

·  Registers - Displays the current values of all of the registers. You can right click on a register and change its value.

·  code window - defaults to the middle left window. Displays the code that you are debugging and allows you to set/clear breakpoints

o  Setting breakpoints - right click on the area to the left of the line where you want to place a breakpoint

o  The current line to be executed will be highlighted in green.

·  outline window - defaults to the middle right window. The outline window allows you to jump to points in your code specified by your outline. The window displays the following:

o  includes statements

o  function prototypes

o  functions

·  console window - defaults to the bottom window. Dsplays various outputs from your program/grmon/debugger etc. The following tabs give information about the current run of your program.

o  Terminate - terminates the debug process

o  clear console - clears the current displayed console

o  scroll lock - keeps the console from scrolling

o  pin console - keeps the console from changing automatically

o  display selected console - switches to a different console view

o  open console - opens a new console

·  memory - displays values of memory at locations that you specify. The memory tab has the following buttons.

o  add memory monitor - request a memory address to view

o  remove memory monitor - removes the selected monitor

o  remove all - removes all memory monitors

·  disassembly - will show up in the outline window by default and allows you to see the assembly for your code.

Other windows and windows that you can be closed can be reopened by clicking on window-> show view and selecting the window you wish to view


Installation instructions

1.  Install Eclipse (3.1.2 or better) and the Java Runtime Environment (1.4 or better) from http://www.eclipse.org/downloads/

2.  To install CDT plug-in:

a.  launch eclipse

b.  click on: help->software update->find and install

c.  select: "Search for new features to install" hit next

d.  create a new remote site

e.  Name: CDT

f.  URL: http://download.eclipse.org/tools/cdt/releases/eclipse3.1

g.  make sure just CDT's box is checked and hit finish

h.  select a mirror and hit ok

i.  follow instructions and install the latest version of the CDT

j.  Reload the workspace when prompted.

3.  To install Gaisler CDT plug-in, repeat above except use:

a.  Name: Gaisler CDT plug-in

b.  URL: http://www.gaisler.com/eclipse/cdt

C:\Documents and Settings\ed\Application Data\Microsoft\Templates\Normal.dot

Page 1 of 4