Prompts the user with
[E]xit, [H]alt, show [S]tack trace or [P]roceed.
This function is intended to be used for debugging use only.
The following example shows how it can be used together with
the g_log() functions.
int main (intargc, char *argv[]) { g_log_set_handler (MY_LOG_DOMAIN, G_LOG_LEVEL_WARNING | G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL, log_handler, NULL); ...
If "[E]xit" is selected, the application terminates with a call
to _exit(0).
If "[S]tack" trace is selected, g_on_error_stack_trace() is called.
This invokes gdb, which attaches to the current process and shows
a stack trace. The prompt is then shown again.
If "[P]roceed" is selected, the function returns.
This function may cause different actions on non-UNIX platforms.
On Windows consider using the G_DEBUGGER environment
variable (see Running GLib Applications) and
calling g_on_error_stack_trace() instead.
Parameters
prg_name: string
the program name, needed by gdb for the "[S]tack trace" option. If prg_name is null, g_get_prgname() is called to get the program name (which will work correctly if gdk_init() or gtk_init() has been called)
Prompts the user with
[E]xit, [H]alt, show [S]tack trace or [P]roceed. This function is intended to be used for debugging use only. The following example shows how it can be used together with theg_log()functions.If "[E]xit" is selected, the application terminates with a call to _exit(0).
If "[S]tack" trace is selected,
g_on_error_stack_trace()is called. This invokes gdb, which attaches to the current process and shows a stack trace. The prompt is then shown again.If "[P]roceed" is selected, the function returns.
This function may cause different actions on non-UNIX platforms.
On Windows consider using the
G_DEBUGGERenvironment variable (see Running GLib Applications) and callingg_on_error_stack_trace()instead.