[Vm-dev] '-DNDEBUG=0' and '-DDEBUGVM=1'

Igor Stasenko siguctua at gmail.com
Wed Apr 13 16:57:05 UTC 2011


On 13 April 2011 18:52, Mariano Martinez Peck <marianopeck at gmail.com> wrote:
>
> Thanks Eliot for the explanation. So, some of those confs are incorrect. I will commit a fix tonight.
>

And with comments, comments! :)
Thank you both!

> Mariano
>
> On Wed, Apr 13, 2011 at 6:35 PM, Eliot Miranda <eliot.miranda at gmail.com> wrote:
>>
>>
>>
>>
>> On Wed, Apr 13, 2011 at 9:06 AM, Mariano Martinez Peck <marianopeck at gmail.com> wrote:
>>>
>>>
>>> Hi Eliot. I am not sure if I understand correctly these flags, and if I do, then I think the CMake configurations are wrong.
>>>
>>> First, what are those flags intended for?   Which should be tuned on and which one off for both, release and debug ?
>>
>> NDEBUG is a Mac OS X/FreeBSD/Linux flag that controls asserts.  To get asserts working in Cog it was easiest to use this flag.  So if NDEBUG=0 asserts are eliminated and if NDEBUG=1 they are included and cause a warning to be printed to stdout when enabled (via a call to warning).  See platforms/Cross/vm/sqAssert.h.  Hence NDEBUG=0 for production and NDEBUG=1 for debug and assert VMs.
>> DEBUGVM is a flag controlling details of code generation for the entry-points that jump from the interpreter into machine code.  Seer DEBUGVM and Debug in src/vm/cogit.c.  I needed this early on in development when the system was flakey.  Now I never use it.  One might suggest eliminating it but it will probably be useful again when we add new code generators (e.g. for ARM and x86-64).  So DEBUGVM=0 for production and assert VMs and either 1 or 0 for debug VMs, depending on what kind of problems you're looking to debug.
>> HTH
>> Eliot
>>>
>>> In Unix/Windows conf, onlt for release, these are set:
>>> -DDEBUGVM=0 -DNDEBUG
>>>
>>> Mac Carbon release
>>> -DDEBUGVM=0 -DNDEBUG=1
>>>
>>> Mac Cocoa Cog (CocoaIOSCogConfig) debug
>>>  '-DNDEBUG=1' '-DDEBUGVM=0'
>>>
>>> Mac Cocoa Cog (CocoaIOSCogConfig) release
>>> '-DNDEBUG=1' '-DDEBUGVM=0'
>>>
>>> Mac Cocoa Cog MT  debug
>>> -DNDEBUG=0' '-DDEBUGVM=1'
>>>
>>> Mac Cocoa Cog MT  release
>>> '-DNDEBUG=0' '-DDEBUGVM=1'
>>>
>>>
>>> So...this is a mess.  Mac Cocoa Cog MT,  have the same for both release and debug. Is this correct?
>>> Mac Cocoa Cog, idem Mac Cocoa Cog MT
>>>
>>> What is worst, Mac Cocoa Cog MT is the opposite of Mac Cocoa Cog
>>>
>>> so...i have no idea how this should be, but sounds strange for me
>>>
>>> Cheers
>>>
>>> --
>>> Mariano
>>> http://marianopeck.wordpress.com
>>>
>>>
>>
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list