1 <refentry id="glib-running" revision="17 Jan 2002">
3 <refentrytitle>Running GLib Applications</refentrytitle>
4 <manvolnum>3</manvolnum>
5 <refmiscinfo>GLib Library</refmiscinfo>
9 <refname>Running GLib Applications</refname>
11 How to run and debug your GLib application
16 <title>Running and debugging GLib Applications</title>
19 <title>Environment variables</title>
22 GLib inspects a few of environment variables in addition to standard
23 variables like <envar>LANG</envar>, <envar>PATH</envar> or <envar>HOME</envar>.
27 <title><envar>G_BROKEN_FILENAMES<envar></title>
30 If this environment variable is set, GLib assumes that filenames are in
31 the locale encoding rather than in UTF-8.
36 <title><envar>G_MESSAGES_PREFIXED</envar></title>
39 A list of log levels for which messages should be prefixed by the
40 program name and PID of the application. The default is to prefix
41 everything except %G_LOG_LEVEL_MESSAGE and %G_LOG_LEVEL_INFO.
48 <title>Traps and traces</title>
51 Some code portions contain trap variables that can be set during debugging
52 time if GLib has been configured with <option>--enable-debug=yes</option>.
53 Such traps lead to immediate code halts to examine the current program state
58 Currently, the following trap variables exist:
60 static volatile gulong g_trap_free_size;
61 static volatile gulong g_trap_realloc_size;
62 static volatile gulong g_trap_malloc_size;
64 If set to a size > 0, <link linkend="g-free">g_free()</link>,
65 <link linkend="g-realloc">g_realloc()</link> and
66 <link linkend="g-malloc">g_malloc()</link> will be intercepted if the size
67 matches the size of the corresponding memory block. This will only work with
68 <literal>g_mem_set_vtable (glib_mem_profiler_table)</literal> upon startup
69 though, because memory profiling is required to match on the memory block sizes.