[MonoDevelop] Finding where an error occurs

Mike Kestner mkestner at gmail.com
Mon Apr 20 17:37:09 EDT 2009

On Mon, 2009-04-20 at 20:54 +0100, alan battersby wrote:
> Hi,
> When running some code I'm developing I get the GTK error message shown
> below.
> (OTWorkbench:17173): Gtk-CRITICAL **: gtk_tree_store_get_value:
> assertion `VALID_ITER (iter, tree_store)' failed
> Stuff still seems to work but I want to remove the problem. So Is there
> a way to relate the 17173 to a line number in one of my several classes
> that use a tree store? If not what is the best way to find out where
> this is occurring?

Add the following line to your application:

GLib.Log.SetLogHandler ("Gtk", GLib.LogLevelFlags.All, new GLib.LogFunc

That will cause a stack trace dump any time a Gtk log warning occurs.
We have an environment variable GTK_SHARP_DEBUG which automatically does
this for GLib-GObject warnings.  We probably need to add a similar check
for the Gtk log domain as well.

Mike Kestner <mkestner at gmail.com>

More information about the Monodevelop-list mailing list