[mercury-users] Debug prints get optimized away

Ian MacLarty maclarty at cs.mu.OZ.AU
Tue Feb 21 05:22:59 AEDT 2006


On Mon, Feb 20, 2006 at 05:03:55PM +0100, Ondrej Bojar wrote:
> Hi.
> 
> Is there a way to produce (impure) debugging prints so that the call is 
> not optimized away?
> 

Try compiling your program without optimisations (pass "-O0" or "-O-1"
to mmc).

Alternatively get friendly with the debugger :-).  We generally find
the debugger is sufficient for finding most faults in Mercury code
without the need for printf style debugging.  Features of the debugger
you may want to look at are conditional breakpoints and the printing and
term browsing facilities.

Ian.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list