开发者

How to load and compile Gedit+GTK+ sources for debugger

I would like to learn how to make a text editor using GTK+. I think the best way to do this is to watch what is happening in the code when one runs Gedit. I have been told that one has to compile the sources of Gedit and GTK+ for -g option. But as I am a very beginner of open source world, I would like to know

  1. How can I load the sources of GTK+ and Gedit to my computer?
  2. How to compile them to one package which can run on debugger?
  3. How to run the Gedit and debugger so that I can see what is going on when one runs the program?

I'm using Ubu开发者_开发问答ntu 10.04. I haven't done debugging earlier so I thought that DDD or Nemiver would be the easiest to learn but any suggestions are welcome.


For Ubuntu, simply do:

cd ~/Desktop  # or wherever you want it
apt-get source gedit  # does not need sudo

Check the README / INSTALL files - they should give you plenty information about compiling, just adapt the instructions to your needs. For a simple compile it's just:

  ./configure
  make

The GEdit main development page is at: http://git.gnome.org/browse/gedit/
You can get the upstream source code using git clone git://git.gnome.org/gedit


You should use ./configure --enable-debug so it contains debug information in the first place (usually, C executable don't which is why they are so small). So to correct the above from what you have now: make clean ./configure --enable-debug make

In DDD, F5 is step, F6 is next, F8 is finish and you can set breakpoints.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜