1

i would like to look inside of a GdkPixbuf structure for debugging purposes. but all i get is a <incomplete type> message.

ill show you a little snippet of example code.

//load image
GtkWidget *image = gtk_image_new_from_file("image.bmp");

//get the GdkPixbuf representation of the image
GdkPixbuf *pixbuff = gtk_image_get_pixbuf(GTK_IMAGE(image));

ok now i when i try to look inside the pixbuff structure i get the <incomplete type> message. How do i correctly look inside this structure using ddd or gdb debuggers ? im new a coding c and debugging.

ive tried the following in ddd

graph display (GdkPixbuf *)pixbuff and also right clicking on the variable and using different display options to no avail.

any ideas on how to correctly look inside this structure ?

Dmitry
  • 17,078
  • 2
  • 44
  • 70
maxim
  • 167
  • 1
  • 7

2 Answers2

0

Try to cast it to GdkPixbuf * before printing. See also this question How to print <incomplete type> variable in gdb.

(gdb) p (GdkPixbuf *)pixbuff
Community
  • 1
  • 1
ks1322
  • 33,961
  • 14
  • 109
  • 164
0

I can't tell you how to do this in gdb but if you are open for other ideas, you can try this with gtkparasite like this: GTK_MODULES=gtkparasite yourapp. If you ever used Spy++ on Windows, it will fit right in.

aquaherd
  • 444
  • 4
  • 12