From: Tobias Ulmer Date: Tue, 10 Jul 2012 14:09:32 +0000 (+0200) Subject: Improve module guessing X-Git-Tag: e2factory-2.3.12rc1~14 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=71f64e827b23e7a4d6099c70e3f0383b163804d6;p=e2factory.git Improve module guessing Signed-off-by: Tobias Ulmer --- diff --git a/generic/e2lib.lua b/generic/e2lib.lua index 8007870..bdc1d76 100644 --- a/generic/e2lib.lua +++ b/generic/e2lib.lua @@ -316,11 +316,20 @@ function tracer(event, line) end -- approximate module name, not always accurate but good enough - local module = string.match(ftbl.short_src, "(%w+)") - module = module or "" + local module + if ftbl.source == nil or ftbl.source == "=[C]" then + module = "" + else + module = string.match(ftbl.source, "(%w+)%.lua$") + module = module .. "." + end + + if module == nil then + module "." + end if event == "call" then - local out = string.format("%s.%s(", module, ftbl.name) + local out = string.format("%s%s(", module, ftbl.name) for lo = 1, 10 do local name, value = debug.getlocal(2, lo) if name == nil or name == "(*temporary)" then @@ -335,7 +344,7 @@ function tracer(event, line) out = out .. ")'" e2lib.log(4, out) else - e2lib.log(4, string.format("< %s.%s", module, ftbl.name)) + e2lib.log(4, string.format("< %s%s", module, ftbl.name)) end end