RE: How to debug gtk application using gdb in Fedora
- From: "Huang, FrankR" <FrankR Huang amd com>
- To: <jcupitt gmail com>
- Cc: gtk-list gnome org
- Subject: RE: How to debug gtk application using gdb in Fedora
- Date: Wed, 14 Apr 2010 16:24:37 +0800
Yes. I want to debug into the gtk kernel. So I "enable-debug=yes".
I forget use LD_LIBRARY_PATH to load my compiled gtk library. After export this parameter, I can get into the gtk code.
I use ddd as my default gdb debug tool.
From: jcupitt gmail com [mailto:jcupitt gmail com]
Sent: 2010年4月14日 16:08
To: Huang, FrankR
Cc: gtk-list gnome org
Subject: Re: How to debug gtk application using gdb in Fedora
On 14 April 2010 08:14, Huang, FrankR <FrankR Huang amd com> wrote:
> I want to know the gtk application call to the glib and gtk
> library, such as the gtk_init(). How to step into it?
Make sure you've built your program with the "-g" flag, then type
$ gdb myapp
(gdb) break gtk_init
There are also plenty of GUI wrappers over gdb, such as kdbg or even
ddd. You might find them easier to use.
valgrind is very useful for debugging memory errors.
> I have compiled the gtk+-2.18.9 with the option
You only need to do this if you want to debug the internals of gtk.
Even then, there are probably already debug versions of the libraries
in your package manager. Just build your program with -g.
] [Thread Prev