Category: MySQLDevelopment

Eclipse/CDT on Linux and Mac OS X

Contents

[edit] Installation of Eclipse/CDT Europa edition

[edit] Requirements

To run Eclipse you will need JRE 1.5.x or JRE 1.6.x.

[edit] Prepare your source tree

For this documentation we assume that you have your working copy at:

  $HOME/work/mysql/mysql-6.0-falcon

Before using the MySQL source tree with Eclipse run the appropriate "BUILD/compile-xyz -c" script (notice the "-c" option). This way we get working Make files without building the whole source tree. These Make files  are ready for use by Eclipse/CDT .

[edit] Installation

Installation got easier now: just go to

  http://www.eclipse.org/downloads/ 

and downlad

  Eclipse IDE for C/C++ Developers

for your platform. We tested this setup with Linux 32-bit/64-bit and Mac/Intel OS X.

You will need at least Eclipse 3.3(aka Europa) for this guide to work.

[edit] Setup of development environment to work with MySQL

[edit] Create a project

Image:picture_3.png


Image:picture_4.png


Image:picture_5.png


[edit] Adjust the build settings

Image:picture_6.png


[edit] Test the build environment

[edit] Debug with Eclipse/CDT

[edit] Create debug profile

In the icon bar click the bug symbol and choose "Open Debug Dialog". In the "Create, manage, and run configurations" choose "C/C++ Local Application" and in the "Main" tab tell where the mysqld executable is located.

Image:picture_7.png


In the "Arguments" tab declare the options for running mysqld (for instance the parameters of mysql-test-run.pl --manual-debug).

Image:picture_8.png


In the "Debugger" tab make sure that you use gdb/mi as debugger.

Image:picture_9.png


[edit] Using the Eclipse/CDT debugger

[edit] Starting the debugger

To start debugging mysqld click on the bug symbol in the symbol menu and choose the debug profile, which we have just created.

[edit] The "Debug Perspective"

Eclipse switches to the "Debug Perspective" with 5 view ports and several tabs. We will describe briefly all view ports.

Image:picture_10.png

[edit] Using the Eclipse debugger

We step through the code with the usual options "Step Into", "Step Over", and "Step Return". These options are also bound to the F5, F6, and F7 keys.

The line, which will be executed next is higlighted. Pointing the mouse over a variable shows it's value. If it is a combined variable like Class->member, then pointing on "member" shows the member's datatype and marking "Class->member" and pointing to it shows the value.

You can also Navigate through the code by CTRL-click[1] on a function, which leads you to the function in most cases. You can also right-click on a symbol to get to it's declaration or definition

[1] On Mac OS X it's Apple-click.

[edit] Notes

[edit] Things I haven't figured out yet

Retrieved from "http://forge.mysql.com/wiki/Eclipse/CDT_on_Linux_and_Mac_OS_X"

This page has been accessed 39,580 times. This page was last modified 04:03, 4 October 2009.

Find

Browse
MySQLForge
Main Page
Current events
Recent changes
Random page
Help
Edit
Edit this page
Editing help
This page
Discuss this page
Post a comment
Printable version
Context
Page history
What links here
Related changes
My pages
Special pages
New pages
File list
Statistics
Bug reports
More...