<div dir="ltr">Hi Tim,<br><br><br>On Thu, Jul 3, 2014 at 1:58 PM, gettimothy &lt;<a href="mailto:gettimothy@zoho.com">gettimothy@zoho.com</a>&gt; wrote:<br>&gt;<br>&gt;  <br>&gt; Hi all.<br>&gt;<br>&gt; If you could point me in the right direction to think this through, I would be much obliged.<br>
&gt;<br>&gt; in oscogvm/build.linux32x86/squeak.cog.v3/build.debug<br>&gt;<br>&gt; I must add the -DNDEBUG flag in order to compile (i.e. disable assertions). If I enable assertions compilation fails  early.<br><br><br>The question is why does compilation fail?  Of course one cannot accept defining -NDEBUG to Debug builds because... the point of debug builds is to debug, and the primary information in the VM for debugging is assertions.<br>
<br> <br>&gt;<br>&gt;<br>&gt; I am not sure how to think about this.<br>&gt;<br>&gt; I don&#39;t know if these are appropriate errors or not, but here are the first two <br>&gt;<br>&gt;<br>&gt;  <br>&gt; /....oscogvm/src/vm/gcc3x-cointerp.c:9098:1: error: conflicting types for &#39;activateCoggedNewMethod&#39;<br>
&gt; activateCoggedNewMethod(sqInt inInterpreter)<br>&gt; ^<br>&gt; /....oscogvm/src/vm/gcc3x-cointerp.c:367:13: note: previous declaration of &#39;activateCoggedNewMethod&#39; was here<br>&gt; static void activateCoggedNewMethod(sqInt inInterpreter) NoDbgRegParms;<br>
<br><br>This is orthogonal to assertions.  The idea is to add an optional pragma that will prevent the compiler optimizing the calling convention for static methods so on cannot use them from gdb (most annoying).  here&#39;s the checkin comment from r2922:<br>
 <br>In non-production VMs add an attribute to disable register parameters (at least<br>for GCC-compliant compilers), allowing all static functions to be called from<br>gdb even in the -O1 assert VMs.<br><br>So the thing to do is work out why NoDbgRegParms is being defined as something that causes an error.<br>
<br>here&#39;s the relevant code from e.g. src/vm/gcc3x-cointerp.c<br><br><font face="comic sans ms, sans-serif">/*** Function Prototypes ***/<br><br><br>#if defined(PRODUCTION) &amp;&amp; !PRODUCTION &amp;&amp; defined(__GNUC__) &amp;&amp; !defined(NoDbgRegParms)</font><div>
<font face="comic sans ms, sans-serif"># define NoDbgRegParms __attribute__ ((regparm (0)))<br>#endif<br><br>#if !defined(NoDbgRegParms)<br># define NoDbgRegParms /*empty*/<br>#endif</font><br><br>so the idea is that on debug &amp; assert builds, e.g.<br>
<br><font face="comic sans ms, sans-serif">static void addNewMethodToCache(sqInt classObj) NoDbgRegParms; </font><br><br>becomes<br><br><font face="comic sans ms, sans-serif">static void addNewMethodToCache(sqInt classObj) __attribute__ ((regparm (0)));</font><br>
<br>so that classObj won&#39;t be passed in a register and hence one can call the function successfully from within gdb (useful for printing routines etc), but that on production builds it becomes<br><br><font face="comic sans ms, sans-serif">static void addNewMethodToCache(sqInt classObj);</font><br>
<br>So we can have our cake and debug it, so to speak.<br><br>I&#39;m confused as to how the CMake stuff can interfere with this simple scheme.  t&#39;s just simple #defines after all...<br>--<br>best,<br>Eliot<br><div class="gmail_extra">

</div></div></div>