[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Debugging
- From: Dirk Laurie <dpl@...>
- Date: Fri, 12 Aug 2011 15:46:56 +0200
On Fri, Aug 12, 2011 at 03:19:18PM +0200, Jose Marin wrote:
> These tools allow me to insert break points, trace function calls,
> check variables values, and so on.
> But for Lua I still don´t have a debug strategy.
> How do you debug your Lua code?
I don't use interactive debuggers, I put statements like
print (function_name.." parameters ", ...)
assert(x, "x not defined yet? This is a bug")
in the code right from the start and gradually comment them out with
until all are gone. Occasionally re-enabling one of the other by
changing `--[[` to `---[[`, as recommended at the end of PiL §1.2.
> Also, do you use strict.lua in your production code?