4
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
5
<title>Debugging</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2">
7
7
<link rel="start" href="index.html" title="Libbonobo Reference Manual">
8
8
<link rel="up" href="misc.html" title="Miscellaneous">
9
9
<link rel="prev" href="misc.html" title="Miscellaneous">
30
30
<div class="refentry" lang="en">
31
31
<a name="debugging"></a><div class="titlepage"></div>
32
32
<div class="refsect1" lang="en">
33
<a name="id2664947"></a><h2>Debugging</h2>
33
<a name="id3147663"></a><h2>Debugging</h2>
34
34
<p>Bonobo component debugging advice, version 0.1
35
35
by Michael Meeks <mmeeks@gnu.org></p>
36
36
<p>Since it is not transparently obvious how to debug
37
37
Bonobo components the following suggestions may be of use.</p>
38
38
<div class="refsect2" lang="en">
39
<a name="id2664737"></a><h3>Read the FAQ</h3>
39
<a name="id3147453"></a><h3>Read the FAQ</h3>
40
40
<p>This will cover particularly common errors and their
41
41
solutions obviating the need for further debugging.</p>
44
44
<div class="refsect2" lang="en">
45
<a name="id2664747"></a><h3>Versions</h3>
45
<a name="id3147464"></a><h3>Versions</h3>
46
46
<p> It is vital to ensure that the correct versions of
47
47
both the component and the container are being
48
48
run. The safest way to make sure this is the case is
49
49
to explicitly specify the path eg. </p>
50
<span><strong class="command"> ./bonobo-my-component & ./my-test-container </strong></span>
50
<span class="command"><strong> ./bonobo-my-component & ./my-test-container </strong></span>
53
53
<div class="refsect2" lang="en">
54
<a name="id2665842"></a><h3>Correct install</h3>
54
<a name="id3148559"></a><h3>Correct install</h3>
55
55
<p>It is rather important to make sure that bonobo has
56
56
compiled and installed correctly. If you are using CVS
57
57
ensure that your bonobo has installed without errors
61
61
<div class="refsect2" lang="en">
62
<a name="id2665854"></a><h3>Stale processes</h3>
62
<a name="id3148571"></a><h3>Stale processes</h3>
63
63
<p>It is a good idea to check there are no stale
64
64
component processes running in the background, check
66
<span><strong class="command">ps ax | grep 'bonobo-my-component'</strong></span><p>or just:</p>
67
<span><strong class="command">bonobo-slay</strong></span>
66
<span class="command"><strong>ps ax | grep 'bonobo-my-component'</strong></span><p>or just:</p>
67
<span class="command"><strong>bonobo-slay</strong></span>
70
70
<div class="refsect2" lang="en">
71
<a name="id2665880"></a><h3>Debugging</h3>
71
<a name="id3148597"></a><h3>Debugging</h3>
72
72
<p>So: debugging. The best way to do this is to have
73
73
two X-terms, in one run the component:</p>
74
<span><strong class="command"><pre class="screen">
74
<span class="command"><strong><pre class="screen">
75
75
gdb ./bonobo-my-component
77
77
</pre></strong></span><p>And in the second run the container:</p>
78
<span><strong class="command"><pre class="screen">
78
<span class="command"><strong><pre class="screen">
79
79
gdb ./my-test-container
81
81
</pre></strong></span><p>Putting breakpoints in shared libraries such as
87
87
help; libtool creates a shell script in place of the
88
88
binary to allow non-installed libraries to be linked
89
89
correctly. That aside you need to do:</p>
90
<span><strong class="command">$ libtool gdb ./my-program-name.</strong></span><p>NB. don't go fiddling in <code class="filename">.libs</code>,
90
<span class="command"><strong>$ libtool gdb ./my-program-name.</strong></span><p>NB. don't go fiddling in <code class="filename">.libs</code>,
91
91
you will get burned. NNB. it seems that emacs' debug
92
92
mode doesn't like this; you have to write a small
93
93
<code class="literal">'libtool gdb</code>' wrapper script
97
97
<div class="refsect2" lang="en">
98
<a name="id2665957"></a><h3>CORBA method tracing</h3>
98
<a name="id3148674"></a><h3>CORBA method tracing</h3>
99
99
<p>There is beautiful built in ORBit2 method tracing
100
100
facility that will show you all CORBA invocations,
101
101
their objects, arguments, microsecond timestamps
109
109
<div class="refsect2" lang="en">
110
<a name="id2665977"></a><h3>Order of execution</h3>
110
<a name="id3148693"></a><h3>Order of execution</h3>
111
111
<p>It is of course important to ensure that the
112
112
component has registered before executing the
113
113
container. A good guide is to wait until your hard
118
118
<div class="refsect2" lang="en">
119
<a name="id2665989"></a><h3>Nothing will activate!</h3>
120
<span><strong class="command"><pre class="screen">
119
<a name="id3148706"></a><h3>Nothing will activate!</h3>
120
<span class="command"><strong><pre class="screen">
121
121
export BONOBO_ACTIVATION_DEBUG_OUTPUT=1
123
123
</pre></strong></span><p> And try again - it's possible that a debug message
128
128
<div class="refsect2" lang="en">
129
<a name="id2666011"></a><h3>Nothing seems to happen, the code just locks</h3>
129
<a name="id3148727"></a><h3>Nothing seems to happen, the code just locks</h3>
130
130
<p>Check that you are doing either a
131
131
<code class="function">bonobo_main()</code> or a
132
132
<code class="function">bonobo_activate()</code> followed by
140
140
<div class="refsect2" lang="en">
141
<a name="id2666042"></a><h3>Getting more information</h3>
141
<a name="id3148759"></a><h3>Getting more information</h3>
142
142
<p>If you are doing serious development consider
143
143
compiling gtk+, glib and bonobo with debugging
145
<span><strong class="command">export CFLAGS='-g' ; ./configure</strong></span><p>If you suspect the name server of causing problems
145
<span class="command"><strong>export CFLAGS='-g' ; ./configure</strong></span><p>If you suspect the name server of causing problems
147
<span><strong class="command">export BONOBO_ACTIVATION_DEBUG_EXERUN=1</strong></span><p>to get debug to the console, simply adding a
147
<span class="command"><strong>export BONOBO_ACTIVATION_DEBUG_EXERUN=1</strong></span><p>to get debug to the console, simply adding a
148
148
breakpoint in <code class="function">g_log</code> will help get
149
149
at the innards of the bonobo-activation
153
153
<div class="refsect2" lang="en">
154
<a name="id2666082"></a><h3>Debugging bonobo-activation</h3>
154
<a name="id3148798"></a><h3>Debugging bonobo-activation</h3>
155
155
<p> This is often best done by running: </p>
156
<span><strong class="command"><pre class="screen">
156
<span class="command"><strong><pre class="screen">
157
157
gdb ./bonobo-activation
159
159
</pre></strong></span><p>
164
164
<div class="refsect2" lang="en">
165
<a name="id2666106"></a><h3>The last resort</h3>
165
<a name="id3148823"></a><h3>The last resort</h3>
166
166
<p>And finally when the handfuls of hair are coming out
167
167
thick and fast, consider reading the source, it only
168
168
looks scary, it won't bite.</p>
171
171
<div class="refsect2" lang="en">
172
<a name="id2666117"></a><h3>Talk to the experts.</h3>
173
<p> Try reading the mailing list <a href="http://www.gnome.org/mailing-lists/archives/gnome-components-list/" target="_top">
172
<a name="id3148834"></a><h3>Talk to the experts.</h3>
173
<p> Try reading the mailing list <a class="ulink" href="http://www.gnome.org/mailing-lists/archives/gnome-components-list/" target="_top">
174
174
archive </a>. </p>
176
176
Alternatively if you wish to buy in the programming expertise to meet
177
an agressive deadline see: <a href="http://www.gnome-support.com" target="_top">http://www.gnome-support.com</a>.
177
an agressive deadline see: <a class="ulink" href="http://www.gnome-support.com" target="_top">http://www.gnome-support.com</a>.