~ubuntu-branches/debian/squeeze/glib2.0/squeeze

« back to all changes in this revision

Viewing changes to docs/reference/glib/xml/warnings.xml

  • Committer: Bazaar Package Importer
  • Author(s): Gustavo Noronha Silva
  • Date: 2009-02-15 13:00:43 UTC
  • mfrom: (1.3.1 upstream) (69.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20090215130043-q47fbt3owmt42m2f
Tags: 2.18.4-2
* Release to unstable
* debian/rules:
- bump SHVER, since we are already forcing a 2.18.0 dependecy on the
  symbols introduced in the development versions
* debian/control.in:
- added Homepage and Vcs-* control fields

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<refentry id="glib-Warnings-and-Assertions">
2
2
<refmeta>
3
 
<refentrytitle role="top_of_page">Message Output and Debugging Functions</refentrytitle>
 
3
<refentrytitle role="top_of_page" id="glib-Warnings-and-Assertions.top_of_page">Message Output and Debugging Functions</refentrytitle>
4
4
<manvolnum>3</manvolnum>
5
5
<refmiscinfo>GLIB Library</refmiscinfo>
6
6
</refmeta>
8
8
<refnamediv>
9
9
<refname>Message Output and Debugging Functions</refname>
10
10
<refpurpose>functions to output messages and help debug applications</refpurpose>
11
 
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
12
11
</refnamediv>
13
12
 
14
 
<refsynopsisdiv role="synopsis">
 
13
<refsynopsisdiv id="glib-Warnings-and-Assertions.synopsis" role="synopsis">
15
14
<title role="synopsis.title">Synopsis</title>
16
15
 
17
16
<synopsis>
18
17
 
19
18
#include &lt;glib.h&gt;
20
19
 
21
 
 
22
20
<link linkend="void">void</link>                <link linkend="g-print">g_print</link>                             (const <link linkend="gchar">gchar</link> *format,
23
21
                                                         ...);
24
22
<link linkend="GPrintFunc">GPrintFunc</link>          <link linkend="g-set-print-handler">g_set_print_handler</link>                 (<link linkend="GPrintFunc">GPrintFunc</link> func);
34
32
#define             <link linkend="g-return-val-if-reached">g_return_val_if_reached</link>             (val)
35
33
#define             <link linkend="g-warn-if-fail">g_warn_if_fail</link>                      (expr)
36
34
#define             <link linkend="g-warn-if-reached">g_warn_if_reached</link>                   ()
37
 
<link linkend="void">void</link>                <link linkend="g-warn-message">g_warn_message</link>                      (const <link linkend="char">char</link> *domain,
38
 
                                                         const <link linkend="char">char</link> *file,
39
 
                                                         <link linkend="int">int</link> line,
40
 
                                                         const <link linkend="char">char</link> *func,
41
 
                                                         const <link linkend="char">char</link> *warnexpr);
42
35
 
43
36
<link linkend="void">void</link>                <link linkend="g-on-error-query">g_on_error_query</link>                    (const <link linkend="gchar">gchar</link> *prg_name);
44
37
<link linkend="void">void</link>                <link linkend="g-on-error-stack-trace">g_on_error_stack_trace</link>              (const <link linkend="gchar">gchar</link> *prg_name);
45
38
 
46
 
#define             <link linkend="G-BREAKPOINT:CAPS">G_BREAKPOINT</link>                        ()
47
 
 
 
39
#define             <link linkend="G-BREAKPOINT--CAPS">G_BREAKPOINT</link>                        ()
48
40
</synopsis>
49
41
</refsynopsisdiv>
50
42
 
56
48
 
57
49
 
58
50
 
59
 
<refsect1 role="desc">
 
51
<refsect1 id="glib-Warnings-and-Assertions.description" role="desc">
60
52
<title role="desc.title">Description</title>
61
53
<para>
62
54
These functions provide support for outputting messages.
63
55
</para>
64
56
<para>
65
 
The <function>g_return</function> family of macros (<link linkend="g-return-if-fail"><function>g_return_if_fail()</function></link>, 
 
57
The <function>g_return</function> family of macros (<link linkend="g-return-if-fail"><function>g_return_if_fail()</function></link>,
66
58
<link linkend="g-return-val-if-fail"><function>g_return_val_if_fail()</function></link>, <link linkend="g-return-if-reached"><function>g_return_if_reached()</function></link>, <link linkend="g-return-val-if-reached"><function>g_return_val_if_reached()</function></link>)
67
59
should only be used for programming errors, a typical use case is
68
60
checking for invalid parameters at the beginning of a public function.
69
61
They should not be used if you just mean "if (error) return", they
70
62
should only be used if you mean "if (bug in program) return".
71
 
The program behavior is generally considered undefined after one of these 
 
63
The program behavior is generally considered undefined after one of these
72
64
checks fails. They are not intended for normal control flow, only to
73
 
give a perhaps-helpful warning before giving up. 
 
65
give a perhaps-helpful warning before giving up.
74
66
</para>
75
67
</refsect1>
76
68
 
77
 
<refsect1 role="details">
 
69
<refsect1 id="glib-Warnings-and-Assertions.details" role="details">
78
70
<title role="details.title">Details</title>
79
 
<refsect2>
80
 
<title><anchor id="g-print" role="function"/>g_print ()</title>
81
 
<indexterm><primary>g_print</primary></indexterm><programlisting><link linkend="void">void</link>                g_print                             (const <link linkend="gchar">gchar</link> *format,
 
71
<refsect2 id="g-print" role="function">
 
72
<title>g_print ()</title>
 
73
<indexterm zone="g-print"><primary sortas="g_print">g_print</primary></indexterm><programlisting><link linkend="void">void</link>                g_print                             (const <link linkend="gchar">gchar</link> *format,
82
74
                                                         ...);</programlisting>
83
75
<para>
84
76
Outputs a formatted message via the print handler.
91
83
Instead, libraries should use <link linkend="g-log"><function>g_log()</function></link>, or the convenience functions
92
84
<link linkend="g-message"><function>g_message()</function></link>, <link linkend="g-warning"><function>g_warning()</function></link> and <link linkend="g-error"><function>g_error()</function></link>.
93
85
</para><variablelist role="params">
94
 
<varlistentry><term><parameter>format</parameter>&nbsp;:</term>
 
86
<varlistentry><term><parameter>format</parameter>&#160;:</term>
95
87
<listitem><simpara>the message format. See the <link linkend="printf"><function>printf()</function></link> documentation.
96
88
</simpara></listitem></varlistentry>
97
 
<varlistentry><term><parameter>...</parameter>&nbsp;:</term>
 
89
<varlistentry><term><parameter>...</parameter>&#160;:</term>
98
90
<listitem><simpara>the parameters to insert into the format string.
99
 
 
100
 
 
101
91
</simpara></listitem></varlistentry>
102
92
</variablelist></refsect2>
103
 
<refsect2>
104
 
<title><anchor id="g-set-print-handler" role="function"/>g_set_print_handler ()</title>
105
 
<indexterm><primary>g_set_print_handler</primary></indexterm><programlisting><link linkend="GPrintFunc">GPrintFunc</link>          g_set_print_handler                 (<link linkend="GPrintFunc">GPrintFunc</link> func);</programlisting>
 
93
<refsect2 id="g-set-print-handler" role="function">
 
94
<title>g_set_print_handler ()</title>
 
95
<indexterm zone="g-set-print-handler"><primary sortas="g_set_print_handler">g_set_print_handler</primary></indexterm><programlisting><link linkend="GPrintFunc">GPrintFunc</link>          g_set_print_handler                 (<link linkend="GPrintFunc">GPrintFunc</link> func);</programlisting>
106
96
<para>
107
97
Sets the print handler.
108
98
Any messages passed to <link linkend="g-print"><function>g_print()</function></link> will be output via the new handler.
110
100
By providing your own handler you can redirect the output, to a GTK+
111
101
widget or a log file for example.
112
102
</para><variablelist role="params">
113
 
<varlistentry><term><parameter>func</parameter>&nbsp;:</term>
 
103
<varlistentry><term><parameter>func</parameter>&#160;:</term>
114
104
<listitem><simpara>the new print handler.
115
105
</simpara></listitem></varlistentry>
116
 
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the old print handler.
117
 
 
118
 
 
 
106
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the old print handler.
119
107
</simpara></listitem></varlistentry>
120
108
</variablelist></refsect2>
121
 
<refsect2>
122
 
<title><anchor id="GPrintFunc" role="function"/>GPrintFunc ()</title>
123
 
<indexterm><primary>GPrintFunc</primary></indexterm><programlisting><link linkend="void">void</link>                (*GPrintFunc)                       (const <link linkend="gchar">gchar</link> *string);</programlisting>
 
109
<refsect2 id="GPrintFunc" role="function">
 
110
<title>GPrintFunc ()</title>
 
111
<indexterm zone="GPrintFunc"><primary sortas="GPrintFunc">GPrintFunc</primary></indexterm><programlisting><link linkend="void">void</link>                (*GPrintFunc)                       (const <link linkend="gchar">gchar</link> *string);</programlisting>
124
112
<para>
125
113
Specifies the type of the print handler functions.
126
114
These are called with the complete formatted string to output.
127
115
</para><variablelist role="params">
128
 
<varlistentry><term><parameter>string</parameter>&nbsp;:</term>
 
116
<varlistentry><term><parameter>string</parameter>&#160;:</term>
129
117
<listitem><simpara>the message to be output.
130
 
 
131
 
 
132
118
</simpara></listitem></varlistentry>
133
119
</variablelist></refsect2>
134
 
<refsect2>
135
 
<title><anchor id="g-printerr" role="function"/>g_printerr ()</title>
136
 
<indexterm><primary>g_printerr</primary></indexterm><programlisting><link linkend="void">void</link>                g_printerr                          (const <link linkend="gchar">gchar</link> *format,
 
120
<refsect2 id="g-printerr" role="function">
 
121
<title>g_printerr ()</title>
 
122
<indexterm zone="g-printerr"><primary sortas="g_printerr">g_printerr</primary></indexterm><programlisting><link linkend="void">void</link>                g_printerr                          (const <link linkend="gchar">gchar</link> *format,
137
123
                                                         ...);</programlisting>
138
124
<para>
139
125
Outputs a formatted message via the error message handler.
143
129
<link linkend="g-printerr"><function>g_printerr()</function></link> should not be used from within libraries. Instead <link linkend="g-log"><function>g_log()</function></link> should
144
130
be used, or the convenience functions <link linkend="g-message"><function>g_message()</function></link>, <link linkend="g-warning"><function>g_warning()</function></link> and <link linkend="g-error"><function>g_error()</function></link>.
145
131
</para><variablelist role="params">
146
 
<varlistentry><term><parameter>format</parameter>&nbsp;:</term>
 
132
<varlistentry><term><parameter>format</parameter>&#160;:</term>
147
133
<listitem><simpara>the message format. See the <link linkend="printf"><function>printf()</function></link> documentation.
148
134
</simpara></listitem></varlistentry>
149
 
<varlistentry><term><parameter>...</parameter>&nbsp;:</term>
 
135
<varlistentry><term><parameter>...</parameter>&#160;:</term>
150
136
<listitem><simpara>the parameters to insert into the format string.
151
 
 
152
 
 
153
137
</simpara></listitem></varlistentry>
154
138
</variablelist></refsect2>
155
 
<refsect2>
156
 
<title><anchor id="g-set-printerr-handler" role="function"/>g_set_printerr_handler ()</title>
157
 
<indexterm><primary>g_set_printerr_handler</primary></indexterm><programlisting><link linkend="GPrintFunc">GPrintFunc</link>          g_set_printerr_handler              (<link linkend="GPrintFunc">GPrintFunc</link> func);</programlisting>
 
139
<refsect2 id="g-set-printerr-handler" role="function">
 
140
<title>g_set_printerr_handler ()</title>
 
141
<indexterm zone="g-set-printerr-handler"><primary sortas="g_set_printerr_handler">g_set_printerr_handler</primary></indexterm><programlisting><link linkend="GPrintFunc">GPrintFunc</link>          g_set_printerr_handler              (<link linkend="GPrintFunc">GPrintFunc</link> func);</programlisting>
158
142
<para>
159
143
Sets the handler for printing error messages.
160
144
Any messages passed to <link linkend="g-printerr"><function>g_printerr()</function></link> will be output via the new handler.
162
146
By providing your own handler you can redirect the output, to a GTK+
163
147
widget or a log file for example.
164
148
</para><variablelist role="params">
165
 
<varlistentry><term><parameter>func</parameter>&nbsp;:</term>
 
149
<varlistentry><term><parameter>func</parameter>&#160;:</term>
166
150
<listitem><simpara>the new error message handler.
167
151
</simpara></listitem></varlistentry>
168
 
<varlistentry><term><emphasis>Returns</emphasis>&nbsp;:</term><listitem><simpara>the old error message handler.
169
 
 
170
 
 
 
152
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>the old error message handler.
171
153
</simpara></listitem></varlistentry>
172
154
</variablelist></refsect2>
173
 
<refsect2>
174
 
<title><anchor id="g-return-if-fail" role="macro"/>g_return_if_fail()</title>
175
 
<indexterm><primary>g_return_if_fail</primary></indexterm><programlisting>#define             g_return_if_fail(expr)</programlisting>
 
155
<refsect2 id="g-return-if-fail" role="macro">
 
156
<title>g_return_if_fail()</title>
 
157
<indexterm zone="g-return-if-fail"><primary sortas="g_return_if_fail">g_return_if_fail</primary></indexterm><programlisting>#define             g_return_if_fail(expr)</programlisting>
176
158
<para>
177
159
Returns from the current function if the expression is not true.
178
 
If the expression evaluates to <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, a critical message is logged and
 
160
If the expression evaluates to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, a critical message is logged and
179
161
the function returns. This can only be used in functions which do not return
180
162
a value.
181
163
</para><variablelist role="params">
182
 
<varlistentry><term><parameter>expr</parameter>&nbsp;:</term>
 
164
<varlistentry><term><parameter>expr</parameter>&#160;:</term>
183
165
<listitem><simpara>the expression to check.
184
 
 
185
 
 
186
166
</simpara></listitem></varlistentry>
187
167
</variablelist></refsect2>
188
 
<refsect2>
189
 
<title><anchor id="g-return-val-if-fail" role="macro"/>g_return_val_if_fail()</title>
190
 
<indexterm><primary>g_return_val_if_fail</primary></indexterm><programlisting>#define             g_return_val_if_fail(expr,val)</programlisting>
 
168
<refsect2 id="g-return-val-if-fail" role="macro">
 
169
<title>g_return_val_if_fail()</title>
 
170
<indexterm zone="g-return-val-if-fail"><primary sortas="g_return_val_if_fail">g_return_val_if_fail</primary></indexterm><programlisting>#define             g_return_val_if_fail(expr,val)</programlisting>
191
171
<para>
192
172
Returns from the current function, returning the value <parameter>val</parameter>, if the expression
193
173
is not true.
194
 
If the expression evaluates to <link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, a critical message is logged and
 
174
If the expression evaluates to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link>, a critical message is logged and
195
175
<parameter>val</parameter> is returned.
196
176
</para><variablelist role="params">
197
 
<varlistentry><term><parameter>expr</parameter>&nbsp;:</term>
 
177
<varlistentry><term><parameter>expr</parameter>&#160;:</term>
198
178
<listitem><simpara>the expression to check.
199
179
</simpara></listitem></varlistentry>
200
 
<varlistentry><term><parameter>val</parameter>&nbsp;:</term>
 
180
<varlistentry><term><parameter>val</parameter>&#160;:</term>
201
181
<listitem><simpara>the value to return from the current function if the expression is not
202
182
true.
203
 
 
204
 
 
205
183
</simpara></listitem></varlistentry>
206
184
</variablelist></refsect2>
207
 
<refsect2>
208
 
<title><anchor id="g-return-if-reached" role="macro"/>g_return_if_reached()</title>
209
 
<indexterm><primary>g_return_if_reached</primary></indexterm><programlisting>#define             g_return_if_reached()</programlisting>
 
185
<refsect2 id="g-return-if-reached" role="macro">
 
186
<title>g_return_if_reached()</title>
 
187
<indexterm zone="g-return-if-reached"><primary sortas="g_return_if_reached">g_return_if_reached</primary></indexterm><programlisting>#define             g_return_if_reached()</programlisting>
210
188
<para>
211
 
Logs a critical message and returns from the current function. 
 
189
Logs a critical message and returns from the current function.
212
190
This can only be used in functions which do not return a value.
213
191
</para></refsect2>
214
 
<refsect2>
215
 
<title><anchor id="g-return-val-if-reached" role="macro"/>g_return_val_if_reached()</title>
216
 
<indexterm><primary>g_return_val_if_reached</primary></indexterm><programlisting>#define             g_return_val_if_reached(val)</programlisting>
 
192
<refsect2 id="g-return-val-if-reached" role="macro">
 
193
<title>g_return_val_if_reached()</title>
 
194
<indexterm zone="g-return-val-if-reached"><primary sortas="g_return_val_if_reached">g_return_val_if_reached</primary></indexterm><programlisting>#define             g_return_val_if_reached(val)</programlisting>
217
195
<para>
218
 
Logs a critical message and returns <parameter>val</parameter>. 
 
196
Logs a critical message and returns <parameter>val</parameter>.
219
197
</para><variablelist role="params">
220
 
<varlistentry><term><parameter>val</parameter>&nbsp;:</term>
 
198
<varlistentry><term><parameter>val</parameter>&#160;:</term>
221
199
<listitem><simpara>the value to return from the current function.
222
 
 
223
 
 
224
 
</simpara></listitem></varlistentry>
225
 
</variablelist></refsect2>
226
 
<refsect2>
227
 
<title><anchor id="g-warn-if-fail" role="macro"/>g_warn_if_fail()</title>
228
 
<indexterm><primary>g_warn_if_fail</primary></indexterm><programlisting>#define             g_warn_if_fail(expr)</programlisting>
229
 
<para>
230
 
 
231
 
</para><variablelist role="params">
232
 
<varlistentry><term><parameter>expr</parameter>&nbsp;:</term>
233
 
<listitem><simpara>
234
 
 
235
 
 
236
 
</simpara></listitem></varlistentry>
237
 
</variablelist></refsect2>
238
 
<refsect2>
239
 
<title><anchor id="g-warn-if-reached" role="macro"/>g_warn_if_reached()</title>
240
 
<indexterm><primary>g_warn_if_reached</primary></indexterm><programlisting>#define             g_warn_if_reached()</programlisting>
241
 
<para>
242
 
 
243
 
</para></refsect2>
244
 
<refsect2>
245
 
<title><anchor id="g-warn-message" role="function"/>g_warn_message ()</title>
246
 
<indexterm><primary>g_warn_message</primary></indexterm><programlisting><link linkend="void">void</link>                g_warn_message                      (const <link linkend="char">char</link> *domain,
247
 
                                                         const <link linkend="char">char</link> *file,
248
 
                                                         <link linkend="int">int</link> line,
249
 
                                                         const <link linkend="char">char</link> *func,
250
 
                                                         const <link linkend="char">char</link> *warnexpr);</programlisting>
251
 
<para>
252
 
 
253
 
</para><variablelist role="params">
254
 
<varlistentry><term><parameter>domain</parameter>&nbsp;:</term>
255
 
<listitem><simpara>
256
 
</simpara></listitem></varlistentry>
257
 
<varlistentry><term><parameter>file</parameter>&nbsp;:</term>
258
 
<listitem><simpara>
259
 
</simpara></listitem></varlistentry>
260
 
<varlistentry><term><parameter>line</parameter>&nbsp;:</term>
261
 
<listitem><simpara>
262
 
</simpara></listitem></varlistentry>
263
 
<varlistentry><term><parameter>func</parameter>&nbsp;:</term>
264
 
<listitem><simpara>
265
 
</simpara></listitem></varlistentry>
266
 
<varlistentry><term><parameter>warnexpr</parameter>&nbsp;:</term>
267
 
<listitem><simpara>
268
 
 
269
 
 
270
 
</simpara></listitem></varlistentry>
271
 
</variablelist></refsect2>
272
 
<refsect2>
273
 
<title><anchor id="g-on-error-query" role="function"/>g_on_error_query ()</title>
274
 
<indexterm><primary>g_on_error_query</primary></indexterm><programlisting><link linkend="void">void</link>                g_on_error_query                    (const <link linkend="gchar">gchar</link> *prg_name);</programlisting>
 
200
</simpara></listitem></varlistentry>
 
201
</variablelist></refsect2>
 
202
<refsect2 id="g-warn-if-fail" role="macro" condition="since:2.16">
 
203
<title>g_warn_if_fail()</title>
 
204
<indexterm zone="g-warn-if-fail" role="2.16"><primary sortas="g_warn_if_fail">g_warn_if_fail</primary></indexterm><programlisting>#define             g_warn_if_fail(expr)</programlisting>
 
205
<para>
 
206
Logs a warning if the expression is not true.
 
207
</para><variablelist role="params">
 
208
<varlistentry><term><parameter>expr</parameter>&#160;:</term>
 
209
<listitem><simpara>the expression to check
 
210
</simpara></listitem></varlistentry>
 
211
</variablelist><para role="since">Since 2.16</para></refsect2>
 
212
<refsect2 id="g-warn-if-reached" role="macro" condition="since:2.16">
 
213
<title>g_warn_if_reached()</title>
 
214
<indexterm zone="g-warn-if-reached" role="2.16"><primary sortas="g_warn_if_reached">g_warn_if_reached</primary></indexterm><programlisting>#define             g_warn_if_reached()</programlisting>
 
215
<para>
 
216
Logs a critical warning.
 
217
</para><para role="since">Since 2.16</para></refsect2>
 
218
<refsect2 id="g-on-error-query" role="function">
 
219
<title>g_on_error_query ()</title>
 
220
<indexterm zone="g-on-error-query"><primary sortas="g_on_error_query">g_on_error_query</primary></indexterm><programlisting><link linkend="void">void</link>                g_on_error_query                    (const <link linkend="gchar">gchar</link> *prg_name);</programlisting>
275
221
<para>
276
222
Prompts the user with <computeroutput>[E]xit, [H]alt, show [S]tack trace or [P]roceed</computeroutput>.
277
223
This function is intended to be used for debugging use only. The following
279
225
</para>
280
226
<informalexample><programlisting>
281
227
&num;include &lt;glib.h&gt;
282
 
 
283
 
static void 
 
228
static void
284
229
log_handler (const gchar   *log_domain,
285
230
             GLogLevelFlags log_level,
286
231
             const gchar   *message,
287
232
             gpointer       user_data)
288
233
{
289
234
  g_log_default_handler (log_domain, log_level, message, user_data);
290
 
 
291
235
  g_on_error_query (MY_PROGRAM_NAME);
292
236
}
293
 
 
294
237
int main (int argc, char *argv[])
295
238
{
296
239
  g_log_set_handler (MY_LOG_DOMAIN,
297
 
                     G_LOG_LEVEL_WARNING | 
298
 
                     G_LOG_LEVEL_ERROR | 
 
240
                     G_LOG_LEVEL_WARNING |
 
241
                     G_LOG_LEVEL_ERROR |
299
242
                     G_LOG_LEVEL_CRITICAL,
300
243
                     log_handler,
301
244
                     NULL);
302
 
 
303
 
 /* ... */  
 
245
 /* ... */
304
246
</programlisting></informalexample>
305
247
<para>
306
248
If [E]xit is selected, the application terminates with a call to
309
251
<para>
310
252
If [H]alt is selected, the application enters an infinite loop.
311
253
The infinite loop can only be stopped by killing the application,
312
 
or by setting <link linkend="glib-on-error-halt"><type>glib_on_error_halt</type></link> to <link linkend="FALSE:CAPS"><literal>FALSE</literal></link> (possibly via a debugger).
 
254
or by setting <link linkend="glib-on-error-halt"><type>glib_on_error_halt</type></link> to <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> (possibly via a debugger).
313
255
</para>
314
256
<para>
315
257
If [S]tack trace is selected, <link linkend="g-on-error-stack-trace"><function>g_on_error_stack_trace()</function></link> is called. This
322
264
<para>
323
265
This function may cause different actions on non-UNIX platforms.
324
266
</para><variablelist role="params">
325
 
<varlistentry><term><parameter>prg_name</parameter>&nbsp;:</term>
 
267
<varlistentry><term><parameter>prg_name</parameter>&#160;:</term>
326
268
<listitem><simpara>the program name, needed by <command>gdb</command> for the [S]tack trace option.
327
 
If <parameter>prg_name</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, <link linkend="g-get-prgname"><function>g_get_prgname()</function></link> is called to get the program name
 
269
If <parameter>prg_name</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, <link linkend="g-get-prgname"><function>g_get_prgname()</function></link> is called to get the program name
328
270
(which will work correctly if <link linkend="gdk-init"><function>gdk_init()</function></link> or <link linkend="gtk-init"><function>gtk_init()</function></link> has been called).
329
 
 
330
 
 
331
271
</simpara></listitem></varlistentry>
332
272
</variablelist></refsect2>
333
 
<refsect2>
334
 
<title><anchor id="g-on-error-stack-trace" role="function"/>g_on_error_stack_trace ()</title>
335
 
<indexterm><primary>g_on_error_stack_trace</primary></indexterm><programlisting><link linkend="void">void</link>                g_on_error_stack_trace              (const <link linkend="gchar">gchar</link> *prg_name);</programlisting>
 
273
<refsect2 id="g-on-error-stack-trace" role="function">
 
274
<title>g_on_error_stack_trace ()</title>
 
275
<indexterm zone="g-on-error-stack-trace"><primary sortas="g_on_error_stack_trace">g_on_error_stack_trace</primary></indexterm><programlisting><link linkend="void">void</link>                g_on_error_stack_trace              (const <link linkend="gchar">gchar</link> *prg_name);</programlisting>
336
276
<para>
337
277
Invokes <command>gdb</command>, which attaches to the current process and shows a stack trace.
338
278
Called by <link linkend="g-on-error-query"><function>g_on_error_query()</function></link> when the [S]tack trace option is selected.
340
280
<para>
341
281
This function may cause different actions on non-UNIX platforms.
342
282
</para><variablelist role="params">
343
 
<varlistentry><term><parameter>prg_name</parameter>&nbsp;:</term>
 
283
<varlistentry><term><parameter>prg_name</parameter>&#160;:</term>
344
284
<listitem><simpara>the program name, needed by <command>gdb</command> for the [S]tack trace option.
345
 
If <parameter>prg_name</parameter> is <link linkend="NULL:CAPS"><literal>NULL</literal></link>, <link linkend="g-get-prgname"><function>g_get_prgname()</function></link> is called to get the program name
 
285
If <parameter>prg_name</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>, <link linkend="g-get-prgname"><function>g_get_prgname()</function></link> is called to get the program name
346
286
(which will work correctly if <link linkend="gdk-init"><function>gdk_init()</function></link> or <link linkend="gtk-init"><function>gtk_init()</function></link> has been called).
347
 
 
348
 
 
349
287
</simpara></listitem></varlistentry>
350
288
</variablelist></refsect2>
351
 
<refsect2>
352
 
<title><anchor id="G-BREAKPOINT:CAPS" role="macro"/>G_BREAKPOINT()</title>
353
 
<indexterm><primary>G_BREAKPOINT</primary></indexterm><programlisting>#define             G_BREAKPOINT()</programlisting>
 
289
<refsect2 id="G-BREAKPOINT--CAPS" role="macro">
 
290
<title>G_BREAKPOINT()</title>
 
291
<indexterm zone="G-BREAKPOINT--CAPS"><primary sortas="G_BREAKPOINT">G_BREAKPOINT</primary></indexterm><programlisting>#define             G_BREAKPOINT()</programlisting>
354
292
<para>
355
293
Inserts a breakpoint instruction into the code.  On x86 and alpha systems
356
294
this is implemented as a soft interrupt and on other architectures it raises
357
 
a <link linkend="SIGTRAP:CAPS"><literal>SIGTRAP</literal></link> signal.
 
295
a <link linkend="SIGTRAP--CAPS"><literal>SIGTRAP</literal></link> signal.
358
296
</para></refsect2>
359
297
 
360
298
</refsect1>
362
300
 
363
301
 
364
302
 
365
 
 
366
 
<refsect1><refsect2 /><refsect2 /></refsect1>
367
303
</refentry>