Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to setup mysql source code in eclipse cdt

I would like to setup mysql source code in eclipse cdt so that I can start investigating the source code. Ideally I would like to be able to compile and run mysql from eclipse so that I can use the eclipse debugger to step through the code.

I've had a search on google, but couldn't find anything appropriate. I was hoping someone on this forum may be able to point me in the right direction. I'd be happy playing with any version of mysql from 5.0 onwards.

Many thanks.

like image 522
Chris Snow Avatar asked May 23 '13 21:05

Chris Snow


2 Answers

Try this:

http://dev.mysql.com/doc/internals/en/guided-tour.html

If you want to evaluate the code then use GNU debugger

  • http://dev.mysql.com/doc/internals/en/guided-tour-majordir.html (see the section "GNU Debugger")
  • http://dev.mysql.com/doc/internals/en/guided-tour.html
  • http://www.gnu.org/software/ddd/manual/
like image 67
sampopes Avatar answered Nov 15 '22 00:11

sampopes


Getting the MySQL-Code is not so easy, but you should follow

http://dev.mysql.com/doc/refman/5.1/en/source-installation.html

http://dev.mysql.com/downloads/mirror.php?id=412906

This is a rpm-package, so hopefully you use linux (and have a rpm-packagemanager).

Otherwise you can use bazaar, but as I tried it the download was really slow. http://dev.mysql.com/doc/refman/5.1/en/installing-development-tree.html

Are you sure to need eclipse for that? The source tree has configure and make and everything you need. Just edit the code with a good sourcecode-editor.

But you asked about eclipse.

In eclipse I do think you need CDT:

http://download.eclipse.org/tools/cdt/releases/juno or indigo or what eclipse you use.

The next step is to import the source tree, so new Projekt C/C++ and Makefile project with existing code. Select the source code tree and import that.

I think from that point on you have more knowledge than me, because I don't use eclipse for now. Either the project is small, then vi is good, or the project is big, then eclipse is far too slow and I use gvim with a bit tuning (ctags, git-plugins etc).

Have Fun!

EDIT: Could @ram2013 not have listet the url http://ftp.nchu.edu.tw/MySQL/tech-resources/articles/mysql-capi-tutorial.html just before I started to invent the wheel? ;-) I think that step-by-step is far more detailed.

like image 37
flaschenpost Avatar answered Nov 14 '22 22:11

flaschenpost