G_DEBUGGER on Windows

I’m developing GTK apps on Windows 10, and often get random crashes. Of course, because of Murphy’s law, everything works fine when I run from the debugger :slight_smile:

I saw that very interesting environment variable G_DEBUGGER in the docs, seems it can automatically attach gdb in case of crash. Anyone knows how to define it properly?

You can click on the search icon in the taskbar, type env, and something along the lines of “Edit environment vriables” will come up, open that.

The window that opens will have a “Edit variables” button that you can click to edit/add/remove environment vriables.

Thanks!
Sadly it’s not exactly what I was looking for (my fault, I was not precise enough in my question), I was interested in what value I should use for the G_DEBUGGER variable.

The doc says the command shall contain %p and %e placeholders, I tested this command:

G_DEBUGGER='gdb -p %p -ex "signal %e"'

but the way I use %e seems incorrect because when gdb starts I see the warning:

Only signals 1-15 are valid as numeric signals.
Use "info signals" for a list of symbolic signals.

So my current point is how to use the signal %e to notify back GLib as described in the doc?

Hi @gwillems! Never tried it myself, but maybe you should have signal-event %e in the variable. See glib/gwin32.c · 2.78.0 · GNOME / GLib · GitLab

1 Like

aaah thanks @lb90 , seems to work: I don’t see warnings, and I don’t get stuck with freezed UI anymore when quitting the debugger :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.