File: debugging.html

package info (click to toggle)
xmlroff 0.6.2-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 36,456 kB
  • sloc: ansic: 178,247; xml: 109,155; sh: 8,973; makefile: 1,331; perl: 30
file content (195 lines) | stat: -rw-r--r-- 11,172 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Debugging xmlroff</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
<meta name="description" content="Debugging xmlroff">
<link rel="start" href="index.html" title="xmlroff Reference Manual">
<link rel="up" href="developers.html" title="Developers' Guide">
<link rel="prev" href="generating-source.html" title="Generating Source">
<link rel="next" href="basic-interface.html" title="Basic Interface">
<meta name="generator" content="GTK-Doc V1.10 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="users.html" title="Users' Guide">
<link rel="chapter" href="developers.html" title="Developers' Guide">
<link rel="chapter" href="object-hierarchy.html" title="Object Hierarchy">
<link rel="chapter" href="object.html" title="FoObject is wonderful">
<link rel="chapter" href="node.html" title="FoNode is wonderful">
<link rel="chapter" href="interfaces.html" title="Interfaces are truly wonderful">
<link rel="chapter" href="formatting-objects.html" title="Formatting Objects are truly wonderful">
<link rel="chapter" href="properties.html" title="Properties">
<link rel="chapter" href="areas.html" title="Area Objects">
<link rel="chapter" href="datatypes.html" title="Datatype Objects">
<link rel="chapter" href="context.html" title="Property Context Object">
<link rel="chapter" href="other-objects.html" title="Other Objects">
<link rel="chapter" href="utility-objects.html" title="Utility Objects">
<link rel="chapter" href="utility-modules.html" title="Utility Modules">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="generating-source.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="developers.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">xmlroff Reference Manual</th>
<td><a accesskey="n" href="basic-interface.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="section" lang="en">
<div class="titlepage"><div>
<div><h2 class="title" style="clear: both">
<a name="debugging"></a>Debugging xmlroff</h2></div>
<div><div class="abstract">
<p class="title"><b>Abstract</b></p>
<p>Debugging xmlroff</p>
</div></div>
</div></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="command-line"></a>Command Line</h3></div></div></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="dump-fo-tree"></a>-d2 command line switch dumps FO tree</h4></div></div></div>
<p>Each node shows its type [FoTree], its address [0x82a0698], and its reference count [1].</p>
<p>Values of the node's properties (GObject properties, which mostly correspond to XSL properties) are shown indented underneath the node information.</p>
<p>Properties of the node's parent type (and that type's parent type, etc.) are shown indented relative to the properties of the node's type.</p>
<pre class="programlisting">[xmlroff]$ ./xmlroff -d2 xmlroff.fo
(process:16930): libfo-DEBUG: FoTree (0x82a0698 : 1)
(process:16930): libfo-DEBUG:     default-master:   0x82c7530
(process:16930): libfo-DEBUG:     master-name hash:
(process:16930): libfo-DEBUG:       first : 0x82c7530
(process:16930): libfo-DEBUG:     page-sequence-master-name hash:
(process:16930): libfo-DEBUG:         generate-reference-area: FALSE
(process:16930): libfo-DEBUG:         allow-mixed-content: FALSE
(process:16930): libfo-DEBUG:         element: (nil)
(process:16930): libfo-DEBUG:         context: 0x82a6d48
(process:16930): libfo-DEBUG:         areas:
(process:16930): libfo-DEBUG:           0x82c6a40
(process:16930): libfo-DEBUG:   root (0x82c6c00 : 1)
(process:16930): libfo-DEBUG:       media-usage (0x82bd838 : 72)
(process:16930): libfo-DEBUG:           FoEnum (0x82be270 : 2) : auto
(process:16930): libfo-DEBUG:         generate-reference-area: FALSE
(process:16930): libfo-DEBUG:         allow-mixed-content: FALSE
(process:16930): libfo-DEBUG:         element: 0x82a8e68
(process:16930): libfo-DEBUG:         context: 0x82dfd48
(process:16930): libfo-DEBUG:         areas:
(process:16930): libfo-DEBUG:           (none)
...</pre>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="dump-area-tree"></a>-d4 command line switch dumps area tree</h4></div></div></div>
<pre class="programlisting">[xmlroff]$ ./xmlroff -d4 xmlroff.fo
(process:16932): libfo-DEBUG: FoAreaTree (0x82c6a40 : 1)
(process:16932): libfo-DEBUG:     context: 0x82c6a90
(process:16932): libfo-DEBUG:       is-first:              true
(process:16932): libfo-DEBUG:       prev-part:             (null)
(process:16932): libfo-DEBUG:       is-last:               true
(process:16932): libfo-DEBUG:       next-part:             (null)
(process:16932): libfo-DEBUG:       next-x:                0 pt
(process:16932): libfo-DEBUG:       next-y:                0 pt
(process:16932): libfo-DEBUG:       available-width:       0 pt
(process:16932): libfo-DEBUG:       available-height:      0 pt
(process:16932): libfo-DEBUG:       child-available-ipdim: 0 pt
(process:16932): libfo-DEBUG:       child-available-bpdim: 0 pt
(process:16932): libfo-DEBUG:       generated-by:          (null)
(process:16932): libfo-DEBUG:       reference:             (null)
(process:16932): libfo-DEBUG:       page:                  (null)
(process:16932): libfo-DEBUG:   FoAreaPage (0x82e4300 : 2)
(process:16932): libfo-DEBUG:       page-number:   1
(process:16932): libfo-DEBUG:       page-width:    576 pt
(process:16932): libfo-DEBUG:       page-height:   792 pt
(process:16932): libfo-DEBUG:       margin-top:    72 pt
(process:16932): libfo-DEBUG:       margin-bottom: 72 pt
(process:16932): libfo-DEBUG:       margin-left:   72 pt
(process:16932): libfo-DEBUG:       margin-right:  72 pt
(process:16932): libfo-DEBUG:           bpd: 3
(process:16932): libfo-DEBUG:           ipd: 1
(process:16932): libfo-DEBUG:           sd:  4
(process:16932): libfo-DEBUG:             x:              0 pt
(process:16932): libfo-DEBUG:             y:              0 pt
(process:16932): libfo-DEBUG:             width:          0 pt
(process:16932): libfo-DEBUG:             height:         0 pt
...</pre>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="dump-pango-info"></a>-d8 command line switch dumps PangoAttribute information</h4></div></div></div>
<pre class="programlisting">[xmlroff]$ ./xmlroff -d8 xmlroff.fo
(process:16933): libfo-DEBUG: get_text_attr_list:: block text: 'xmlroff ? Sun xmlroff XSL Formatter'
(process:16933): libfo-DEBUG: get_text_attr_list:: attr_glist: 0x82aa650
(process:16933): libfo-DEBUG: get_text_attr_list:: attr_glist length: 26
(process:16933): libfo-DEBUG: dump_attr_list:: String:
(process:16933): libfo-DEBUG: dump_attr_list:: start: 0; end: 7
(process:16933): libfo-DEBUG: dump_attr_list:: start: 7; end: 37
(process:16933): libfo-DEBUG: dump_attr_list:: start: 37; end: 2147483647
(process:16933): libfo-DEBUG: dump_attr_list:: Font family:
(process:16933): libfo-DEBUG: dump_attr_list:: start: 0; end: 7; family: mono
(process:16933): libfo-DEBUG: dump_attr_list:: start: 7; end: 37; family: sans-serif
(process:16933): libfo-DEBUG: dump_attr_list:: Font size:
(process:16933): libfo-DEBUG: dump_attr_list:: start: 0; end: 7; size: 10
(process:16933): libfo-DEBUG: dump_attr_list:: start: 7; end: 37; size: 10
...</pre>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="fatal-critical"></a>Aborting on critical log message</h4></div></div></div>
<p>xmlroff often gives "CRITICAL" error messages when something goes wrong.  For example:</p>
<div class="literallayout"><p><code class="computeroutput">(xmlroff:4384): libfo-CRITICAL **:<br>
fo_area_area_split_before_height_check: assertion `max_height &gt; 0'<br>
failed</code></p></div>
<p>If you want to abort on the critical error so you can use a debugger on the core file, according to <a class="ulink" href="http://library.gnome.org/devel/glib/stable/glib-running.html" target="_top">http://library.gnome.org/devel/glib/stable/glib-running.html</a>, if you set G_DEBUG=fatal-critical, xmlroff should abort.</p>
</div>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h3 class="title">
<a name="using-gdb"></a>Using GDB or other debugger</h3></div></div></div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="statically-linked"></a>Statically link xmlroff</h4></div></div></div>
<p>GDB, at least, has more to work with when you build a statically linked xmlroff executable.</p>
<p>Add --enable-static --disable-shared to the configure.in (or autogen.sh if building from CVS) command line.</p>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="break-on"></a>Break on g_log</h4></div></div></div>
<p>If you are getting an error message and you can't work out what's causing it, break on g_log so you break just before the message is emitted.</p>
<p>After the break, you can go up several stack frames to where g_error (or similar) is called.</p>
<p>By going up enough stack frames, you can usually work out what property or what FO experienced the error.</p>
<p>Note that you should disable the breakpoint on g_log if you are going to interactively call any functions that use g_log.</p>
</div>
<div class="section" lang="en">
<div class="titlepage"><div><div><h4 class="title">
<a name="interactive-debug"></a>Functions useful when debugging interatively</h4></div></div></div>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term">fo_object_sprintf(object)</span></p></td>
<td><p>The 'nice' printout of the object.</p></td>
</tr>
<tr>
<td><p><span class="term">fo_object_debug_sprintf(object)</span></p></td>
<td><p>The 'nice' printout of the object plus its adress and reference count.</p></td>
</tr>
<tr>
<td><p><span class="term">fo_object_debug_dump(object,indent)</span></p></td>
<td><p>Dump everything about the object and its descendants (if it's part of a tree, that is).</p></td>
</tr>
<tr>
<td><p><span class="term">fo_node_path_to_root_sprintf(node)</span></p></td>
<td><p>Print XPath-like locator for node.</p></td>
</tr>
<tr>
<td><p><span class="term">fo_node_debug_dump_tree(node)</span></p></td>
<td><p>Dumps just the FoNode objects, not their properties, in the tree rooted at node.</p></td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.10</div>
</body>
</html>