Sign up

Better debug support in visual studio

One problem with gtkD is that because it wraps gtk one ends up with objects that, when inspected in visual studio, look like

  • gtk.CellRenderer.CellRenderer 0x000001b41de225c0 {gtkCellRenderer=0x000001b41f0b1690 {parentInstance={gTypeInstance={gClass=0x000001b41e14f530 {gType=1873124484752}}, ...}, ...}} gtk.CellRenderer.CellRenderer
  • gobject.ObjectG.ObjectG 0x000001b41de225c0 {gObject=0x000001b41f0b1690 {gTypeInstance={gClass=0x000001b41e14f530 {gType=1873124484752}}, ...}, ...} gobject.ObjectG.ObjectG
    object.Object	0x000001b41de225c0 {}	object.Object
    
  • gObject 0x000001b41f0b1690 {gTypeInstance={gClass=0x000001b41e14f530 {gType=1873124484752}}, refCount=10, qdata=0x000001b41f26fd91} gobject.c.types.GObject*
    ownedRef	false	bool
    isGcRoot	true	bool
    signals	0x0000000000000000	gobject.DClosure.DClosure[uint]
    
  • gtkCellRenderer 0x000001b41f0b1690 {parentInstance={gTypeInstance={gClass=0x000001b41e14f530 {gType=1873124484752}}, refCount=10, qdata=0x000001b41f26fd91}, ...} gtk.c.types.GtkCellRenderer*
    parentInstance	{gTypeInstance={gClass=0x000001b41e14f530 {gType=1873124484752}}, refCount=10, qdata=0x000001b41f26fd91 {}}	gobject.c.types.GObject
    priv	0x000001b41f0b1650 {}	gtk.c.types.GtkCellRendererPrivate*
    
  • gtkCellRendererText 0x000001b41f0b1690 {parent={parentInstance={gTypeInstance={gClass=0x000001b41e14f530 {gType=1873124484752}}, refCount=10, qdata=0x000001b41f26fd91}, ...}, ...} gtk.c.types.GtkCellRendererText*
    parent	{parentInstance={gTypeInstance={gClass=0x000001b41e14f530 {gType=1873124484752}}, refCount=10, qdata=0x000001b41f26fd91 {}}, ...}	gtk.c.types.GtkCellRenderer
    priv	0x000001b41f0b15a0 {}	gtk.c.types.GtkCellRendererTextPrivate*
    
    

which is a bunch of useless information that tells one nothing about the information of the object one is dealing with(except the type).

I wonder if this could be improved upon and relevant information could be shown, such as a labels text, etc?

Re: Better debug support in visual studio

On 01-06-2019 21:45, Alex X wrote:

One problem with gtkD is that because it wraps gtk one ends up with objects that, when inspected in visual studio, look like

  • ***

which is a bunch of useless information that tells one nothing about the information of the object one is dealing with(except the type).

I wonder if this could be improved upon and relevant information could be shown, such as a labels text, etc?

I don't think so, for the Label the text is stored in GtkLabelPrivate
for witch GTK doesn't provide a definition.

Maybe the GtkInspector is more useful for things like that, you can
start the GtkInspector by starting your app with the
--gtk-debug=interactive commandline option.

Re: Better debug support in visual studio

On Sat, 1 Jun 2019 23:08:13 +0200, Mike Wey wrote:

On 01-06-2019 21:45, Alex X wrote:

One problem with gtkD is that because it wraps gtk one ends up with objects that, when inspected in visual studio, look like

  • ***

which is a bunch of useless information that tells one nothing about the information of the object one is dealing with(except the type).

I wonder if this could be improved upon and relevant information could be shown, such as a labels text, etc?

I don't think so, for the Label the text is stored in GtkLabelPrivate
for witch GTK doesn't provide a definition.

Maybe the GtkInspector is more useful for things like that, you can
start the GtkInspector by starting your app with the
--gtk-debug=interactive commandline option.

Cool, I didn't even know something like that existed. Is there any way to pop it up programmatically(as once it's closed it's gone ;/). I'd like to assign a hot key to it.

Also, any more useful commands like that?

[I found https://developer.gnome.org/gtk3/stable/gtk-running.html#GTK-Debug-Options which seems to list them. Doesn't say how to do multiple ones. CSV's? SSV's?]

Re: Better debug support in visual studio

On 02-06-2019 02:51, Alex X wrote:

Cool, I didn't even know something like that existed. Is there any way to pop it up programmatically(as once it's closed it's gone ;/). I'd like to assign a hot key to it.

You can enable the hot key by running the following command:

gsettings set org.gtk.Settings.Debug enable-inspector-keybinding true

Then control+shift-D or control+shift-I will open the GtkInspector.

Also, any more useful commands like that?

[I found https://developer.gnome.org/gtk3/stable/gtk-running.html#GTK-Debug-Options which seems to list them. Doesn't say how to do multiple ones. CSV's? SSV's?]

That are the ones that are supported, multiple options can be passed by
separating them with a comma.

--gtk-debug=size-request,interactive

or by passing --gtk-debug more than once:

--gtk-debug=size-request --gtk-debug=interactive