[Glade-devel] Running Glade 3 under a debugger...



Folks

I'm chugging my way through getting my own catalogue developed, but it is
somewhat of a struggle.

I am building glade3 from the sources deb on Ubuntu Edgy. I am trying to
add a catalogue to a stable product not work do development work on a dev
branch. The source deb has been stripped down (no autogen and various
other things).

I started off following Phillipe Bertins mini-howto at:
http://www.brightsoft.be/publications/private/phb/howto_write_a_glade_plugin.html
(once I worked out that the URL on the mailing list gives a 404 'cos it
has a full stop on the end).

So far so good:
* I have made a cut down version of gtk+.xml which is installed.
* I have created a cut-down version of glade-gtk.c and an associated
glade-gtk.h

First major problem, how to compile the damn thing (never programmed C!).
After much faffing I have edited makefile.am to ensure that it picks up
the additional new c file, it makes the new library (equivalent of
libgladegtk.so).

I now have a full compile install cycle working:
* run gnome-autogen.sh (having first bumped the automake version it uses
to 1.9 from 1.4)
* make clean
* make
* sudo make install

With a bit of chopping and changing I can get the code to compile, but
unsurprisingly it doesn't load the catalogue and its widget.

Read up on gdb and start glade under it, to get the following messages:

(glade-3:23420): GLib-GObject-WARNING **: specified class size for type
`FlexerWindow' is smaller than the parent type's `GtkTable' class size

** (glade-3:23420): WARNING **: Could not get the type from "Flexerwindow

** (glade-3:23420): WARNING **: Tried to include undefined widget class
'Flexerwindow' in a widget group

So as I suspect my code is iffy... so lets see if we can get some more
information from the debugger - set a break point in my code, load the
symbol table for the shared library...

Now when I run glade-3 under the debugger is segfaults out giving the
messages:
gdb glade-3
(gdb) file /usr/local/lib/glade3/modules/libgladeflexer.so
Load new symbol table from
"/usr/local/lib/glade3/modules/libgladeflexer.so"? (y or n) y
Reading symbols from /usr/local/lib/glade3/modules/libgladeflexer.so...done.
(gdb) run
Starting program: /usr/local/lib/glade3/modules/libgladeflexer.so
warning: shared library handler failed to enable breakpoint

Program received signal SIGSEGV, Segmentation fault.
0x00000001 in ?? ()
(gdb)

I suspect this is because when I run the standard make && make install it
is not using debugging flags and there is no debugging symbols in the
object code...

So 2 questions:
* is this right?
* how can I get it to build glade3 with debugging symbols?

I tried running gnome-autogen.sh after setting the shell variable CFLAGS
to '-g' but that didn't work...

Any suggestions? comments?

Gordon





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]