<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">

<channel>
<title><![CDATA[Perl 6: SMOP Debugging]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?smop_debugging</link>
<description></description>
<pubDate>Fri, 08 Feb 2008 21:04:50 -0000</pubDate>
<webMaster>synedra@gmail.com</webMaster>
<generator>Socialtext Workspace v2.14.7.2</generator>

<item>
<title><![CDATA[SMOP Debugging]]></title>
<link>http://www.perlfoundation.org/perl6/index.cgi?smop_debugging</link>
<description><![CDATA[<div class="wiki">
<p>
Debugging a libtool package is not that straight forward because of the libtool scripts, which gdb doesn't like at all.</p>
<p>
First thing, you need to get a debug-friendly compilation, to get that you need to do:</p>
<ul>
<li>CFLAGS='-O0 -g3' ./configure &amp;&amp; make clean check</li>
</ul>
<p>
Then, to debug, let's say test/01_smop_lowlevel.t, you must:</p>
<ul>
<li>LD_LIBRARY_PATH=src/.libs/ gdb test/.libs/01_smop_lowlevel.t</li>
</ul>
<p>
This is needed because libtool puts the actual binaries in a .libs directory, and gdb is not happy debugging the script libtool places in the place of the executable.</p>
<p>
If you want to run valgrind to check for memory leaks not reported by the SMOP_LOWLEVEL_MEM_TRACE, you can just</p>
<ul>
<li>LD_LIBRARY_PATH=src/.libs valgrind --tool=memcheck --leak-check=full --show-reachable=yes ./test/.libs/08_native_uint.t</li>
</ul>
<p>
See also <a href="http://www.perlfoundation.org/perl6/index.cgi?smop_hacking" title="(58 months) [SMOP] uses a set of different tools and compilers, and it uses CMake to manage its build process. T...">SMOP Hacking</a></p>
</div>
]]></description>
<author>Daniel Ruoso</author>
<guid isPermaLink="true">http://www.perlfoundation.org/perl6/index.cgi?smop_debugging</guid>
<pubDate>Fri, 08 Feb 2008 21:04:50 -0000</pubDate>
</item>

</channel>
</rss>