Re: Debugging
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Debugging
- From: Dirk Laurie <dpl@...>
- Date: 2011年8月12日 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?
<luddite>
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.
</luddite>
> Also, do you use strict.lua in your production code?
No.
Dirk