lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


you need to write something like "why I'm leaving lua" if you want to get more replies... :-)

Am 14.07.2014 19:58, schrieb Victor Bombi:
monologe continuation:

What I found:
The call ret debug hook is called less frequently but I must use local func = getinfo(2,"f").func in every hook call and it is an expensive call The line debug hook is called much more frequently butt I am just checking if breakpoints[line] exist before going on and it is a very cheap test

That would explain the aparent paradox that got me puzzled and the conclusion would be that it is not worthwhile using the call return hook trick
Best Regards
victor

----- Original Message ----- From: "Victor Bombi" <sonoro@telefonica.net>
To: "Lua mailing list" <lua-l@lists.lua.org>
Sent: Sunday, July 13, 2014 9:37 PM
Subject: Re: debug for call ret implementation


Please say something ... [[;-( ]]

----- Original Message ----- From: "Victor Bombi" <sonoro@telefonica.net>
To: "Lua mailing list" <lua-l@lists.lua.org>
Sent: Tuesday, July 08, 2014 2:41 PM
Subject: Re: debug for call ret implementation


sorry, code should be

local func = getinfo(2,"f").func

if functable[func]==nil then
 local breakpoints = Debugger.breakpoints
 local debuginfo = getinfo(2,"SL")
 local activelines = debuginfo.activelines
 local source = debuginfo.source
 functable[func] = false
 if activelines then
  for line,_ in pairs(activelines) do
   if breakpoints[line] and breakpoints[line][source] then
    functable[func] = true
    break
   end
  end
 end
end

----- Original Message ----- From: "Victor Bombi" <sonoro@telefonica.net>
To: "Lua mailing list" <lua-l@lists.lua.org>
Sent: Tuesday, July 08, 2014 2:36 PM
Subject: debug for call ret implementation


Hello,

Trying to implement the suggestion from PIL book about improving debug hooks being first call ret hooks and then going to line debug hook when we are on target function I have

local func = getinfo(2,"f").func

if functable[func]==nil then
 local breakpoints = Debugger.breakpoints
 local debuginfo = getinfo(2,"SL")
 local activelines = debuginfo.activelines
 local source = debuginfo.source
local func = getinfo(2,"f").func

if functable[func]==nil then
 local breakpoints = Debugger.breakpoints
 local debuginfo = getinfo(2,"SL")
 local activelines = debuginfo.activelines
 local source = debuginfo.source
 functable[func] = false
 if activelines then
  for line,_ in pairs(activelines) do
   if breakpoints[line] and breakpoints[line][source] then
    functable[func] = true
    break
   end
  end
 end
end

then if functable[func]==true I switch to the line hook

It turns out that this debugger is about twice slower than straigth line hook debugger!!!

Was not a good suggestion?
My implementation is really bad?

Thanks
victor bombi