开发者

looking inside a GdkPixbuf structure with ddd or gdb

i would like to look inside of a GdkPixbuf structure for debug开发者_高级运维ging 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 ?


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

(gdb) p (GdkPixbuf *)pixbuff


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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜