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

Mariano Martinez Peck marianopeck at gmail.com
Wed Apr 13 17:13:01 UTC 2011


I've just commited the fix, but not the comment ;)

Seriously, I don't know how we can document this kind of things.
Putting such comments in #compilerFlagsRelease  or #compilerFlagsRelease
doesn't make sense because they are aprox. 12 implementaions...I don't want
to copy paste to all of them. Only in one? it doesn't make sense because
people won't see it. So..how we document this kind of things?  I have no
idea.

The same with class comments. There are so many classes that copy pasting or
documenting only one doesn't make sense.

The only thing I though is doing something like this:


compilerFlagsRelease
    ^#('-g3' '-Os' '-fvisibility=hidden' '-funroll-loops' '-fasm-blocks'
'-finline-functions' '-mfpmath=sse' '-fomit-frame-pointer'
'-march=pentium-m' '-mtune=prescott' '-falign-functions=16' '-fno-gcse'
'-fno-cse-follow-jumps' '-std=gnu99' '-DBUILD_FOR_OSX'
'-DUSE_INLINE_MEMORY_ACCESSORS' '-DLSB_FIRST'
'-DUSE_INLINE_MEMORY_ACCESSORS' '-DHAVE_SYS_TIME_H' '-DHAVE_NANOSLEEP'
'-DNDEBUG=0' , self debugVMFlag: true,  '-DCOGMTVM=0'
'-DUSE_GLOBAL_STRUCT=0' '-DBASE_HEADER_SIZE=4')

>>debugVMFlagEnable: boolean
"THIS flag is blagh...blh..."
^ '-DDEBUGVM=', boolean asNumber asString

or something like that...


cheers

Mariano


On Wed, Apr 13, 2011 at 6:57 PM, Igor Stasenko <siguctua at gmail.com> wrote:

>
> 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.
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110413/27da2b39/attachment-0001.htm


More information about the Vm-dev mailing list