mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 12:25:48 +01:00
gmessages: Give examples of G_DEBUG with gdb in the documentation
Some of the documentation linked to information about G_DEBUG already, but most of it didn’t, and there were no examples. People need obvious examples. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=790157
This commit is contained in:
parent
b778ba3e64
commit
63e9d109fd
@ -389,7 +389,14 @@ myInvalidParameterHandler(const wchar_t *expression,
|
|||||||
*
|
*
|
||||||
* You can make warnings fatal at runtime by setting the `G_DEBUG`
|
* You can make warnings fatal at runtime by setting the `G_DEBUG`
|
||||||
* environment variable (see
|
* environment variable (see
|
||||||
* [Running GLib Applications](glib-running.html)).
|
* [Running GLib Applications](glib-running.html)):
|
||||||
|
*
|
||||||
|
* |[
|
||||||
|
* G_DEBUG=fatal-warnings gdb ./my-program
|
||||||
|
* ]|
|
||||||
|
*
|
||||||
|
* Any unrelated failures can be skipped over in
|
||||||
|
* [gdb](https://www.gnu.org/software/gdb/) using the `continue` command.
|
||||||
*
|
*
|
||||||
* If g_log_default_handler() is used as the log handler function,
|
* If g_log_default_handler() is used as the log handler function,
|
||||||
* a newline character will automatically be appended to @..., and
|
* a newline character will automatically be appended to @..., and
|
||||||
@ -414,7 +421,14 @@ myInvalidParameterHandler(const wchar_t *expression,
|
|||||||
*
|
*
|
||||||
* You can also make critical warnings fatal at runtime by
|
* You can also make critical warnings fatal at runtime by
|
||||||
* setting the `G_DEBUG` environment variable (see
|
* setting the `G_DEBUG` environment variable (see
|
||||||
* [Running GLib Applications](glib-running.html)).
|
* [Running GLib Applications](glib-running.html)):
|
||||||
|
*
|
||||||
|
* |[
|
||||||
|
* G_DEBUG=fatal-warnings gdb ./my-program
|
||||||
|
* ]|
|
||||||
|
*
|
||||||
|
* Any unrelated failures can be skipped over in
|
||||||
|
* [gdb](https://www.gnu.org/software/gdb/) using the `continue` command.
|
||||||
*
|
*
|
||||||
* The message should typically *not* be translated to the
|
* The message should typically *not* be translated to the
|
||||||
* user's language.
|
* user's language.
|
||||||
|
@ -535,6 +535,17 @@ GPrintFunc g_set_printerr_handler (GPrintFunc func);
|
|||||||
*
|
*
|
||||||
* If `G_DISABLE_CHECKS` is defined then the check is not performed. You
|
* If `G_DISABLE_CHECKS` is defined then the check is not performed. You
|
||||||
* should therefore not depend on any side effects of @expr.
|
* should therefore not depend on any side effects of @expr.
|
||||||
|
*
|
||||||
|
* To debug failure of a g_return_if_fail() check, run the code under a debugger
|
||||||
|
* with `G_DEBUG=fatal-criticals` or `G_DEBUG=fatal-warnings` defined in the
|
||||||
|
* environment (see [Running GLib Applications](glib-running.html)):
|
||||||
|
*
|
||||||
|
* |[
|
||||||
|
* G_DEBUG=fatal-warnings gdb ./my-program
|
||||||
|
* ]|
|
||||||
|
*
|
||||||
|
* Any unrelated failures can be skipped over in
|
||||||
|
* [gdb](https://www.gnu.org/software/gdb/) using the `continue` command.
|
||||||
*/
|
*/
|
||||||
#define g_return_if_fail(expr) G_STMT_START{ (void)0; }G_STMT_END
|
#define g_return_if_fail(expr) G_STMT_START{ (void)0; }G_STMT_END
|
||||||
|
|
||||||
@ -559,6 +570,8 @@ GPrintFunc g_set_printerr_handler (GPrintFunc func);
|
|||||||
*
|
*
|
||||||
* If `G_DISABLE_CHECKS` is defined then the check is not performed. You
|
* If `G_DISABLE_CHECKS` is defined then the check is not performed. You
|
||||||
* should therefore not depend on any side effects of @expr.
|
* should therefore not depend on any side effects of @expr.
|
||||||
|
*
|
||||||
|
* See g_return_if_fail() for guidance on how to debug failure of this check.
|
||||||
*/
|
*/
|
||||||
#define g_return_val_if_fail(expr,val) G_STMT_START{ (void)0; }G_STMT_END
|
#define g_return_val_if_fail(expr,val) G_STMT_START{ (void)0; }G_STMT_END
|
||||||
|
|
||||||
@ -567,6 +580,8 @@ GPrintFunc g_set_printerr_handler (GPrintFunc func);
|
|||||||
*
|
*
|
||||||
* Logs a critical message and returns from the current function.
|
* Logs a critical message and returns from the current function.
|
||||||
* This can only be used in functions which do not return a value.
|
* This can only be used in functions which do not return a value.
|
||||||
|
*
|
||||||
|
* See g_return_if_fail() for guidance on how to debug failure of this check.
|
||||||
*/
|
*/
|
||||||
#define g_return_if_reached() G_STMT_START{ return; }G_STMT_END
|
#define g_return_if_reached() G_STMT_START{ return; }G_STMT_END
|
||||||
|
|
||||||
@ -575,6 +590,8 @@ GPrintFunc g_set_printerr_handler (GPrintFunc func);
|
|||||||
* @val: the value to return from the current function
|
* @val: the value to return from the current function
|
||||||
*
|
*
|
||||||
* Logs a critical message and returns @val.
|
* Logs a critical message and returns @val.
|
||||||
|
*
|
||||||
|
* See g_return_if_fail() for guidance on how to debug failure of this check.
|
||||||
*/
|
*/
|
||||||
#define g_return_val_if_reached(val) G_STMT_START{ return (val); }G_STMT_END
|
#define g_return_val_if_reached(val) G_STMT_START{ return (val); }G_STMT_END
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user