[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LUA debugger and conditional breakpoints
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 11 Jul 2002 16:04:51 -0300
> My implementation of breakpoints is as follows: a table in the registry
> contains strings of lua code of the form "return exp" indexed by the
> breakpoint's location stored as a string. [...], but this does not work
> with conditions relating to local variables.
Another option is to precompile your breakpoint code inside a function,
and declare the locals as paramenters to the function. Something like
this:
local pre = {p=nil}
function-to-be-called-at-line-2 ()
if %pre.p == nil then -- first time?
local s = collect_local_names_list()
%pre.p = dostring("return function ("..s..") return "..exp.." end")
end
local v = collect_local_values_list()
if call(%pre.p, v) then ...
end
-- Roberto