lua-users home
lua-l archive

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


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