[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: debug.sethook docs
- From: Roberto Ierusalimschy <roberto@...>
- Date: Mon, 1 Dec 2014 11:44:39 -0200
> I think debug.sethook docs (
> http://www.lua.org/manual/5.2/manual.html#pdf-debug.sethook) should be more
> explicit:
Everything always can be more explicit :)
> 1. It is not clear what value should be passes as "mask" if user wants a
> hook to be called at every instruction - is this value "", is it supported
> at all?;
The documentation says:
The string mask and the number count describe when the hook will be
called. The string mask may have the following characters, with the
given meaning:
c - the hook is called every time Lua calls a function; r - the hook
is called every time Lua returns from a function; l - the hook is
called every time Lua enters a new line of code.
Moreover, with a count different from zero, the hook is called after
every count instructions.
If mask can have any of those characters, it seems to me that it can
also do not have them.
> 2. There is a note "With a count different from zero, the hook is called
> after every count instructions." - it is not clear how debug.sethook works
> when count is not zero and "c", "r" or "l" mask is passed.
Let us assume count is not zero and "c" is the mask. By the first rule,
"the hook is called every time Lua calls a function". By the second
rule, "the hook is called after every count instructions.". So, the hook
is called every time Lua calls a function and the hook is called after
every count instructions.
Anyway, we hope the documentation in 5.3 made both points a little clearer:
http://www.lua.org/work/doc/manual.html#pdf-debug.sethook
The string mask may have any combination of the following characters,
with the given meaning:
[...]
Moreover, with a count different from zero, the hook is called also
after every count instructions.
(Note the "any combination" and "also"...)
> P.S. is it a right place to report such issues?
Yes, here.
-- Roberto