-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Luacov with Wireshark Lua plugin #55
Comments
Check wireshark documentation. They seem to be replacing the debug module
with a debug function.
Probably for sandboxing reasons.
El El mié, 31 de ene. de 2018 a las 11:26, Shakthi Kannan <
notifications@github.com> escribió:
… I have installed luacov (version 0.12.0-1) using luarocks. I am trying to
use the same with a Wireshark Lua dissector plugin.
I have included the following in the top of the Lua dissector plugin:
local luacov = require("luacov")
I start Wireshark as follows:
$ wireshark -r capture.pcapng -X lua_script:dissector.lua
But, the plugin fails to load with the message
"~/.luarocks/share/lua/5.1/luacov/hook.lua:26:attempt to index global
'debug' (a function value)".
How to use luacov with Wireshark Lua plugins?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#55>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABZo7WgXN3yby6ZEe7xy-F7EdApvimHks5tQD_AgaJpZM4RzvYp>
.
|
In hook.lua, when the local variable "name" is assigned the full path of the Lua plugin prefixed by "@", the coverage statistics get generated. Bascially, the following is used to retrieve the name:
So, the following hard-coded assginment works:
Why is the debug module or function used to retrieve the path to the Wireshark Lua plugin? Are there any other alternatives possible, or is there anything that can be set in the Wireshark Lua plugin to satisfy "debug"? |
I don't think it was intentionally done. Someone added logger functions such as "critical", "warn", "message", "info" and "debug". I think that these should be removed or renamed. As a workaround, you can add this to your dissector:
Internally Wireshark uses plain Going back to the Lua manual we find this:
It looks like Wireshark (and all other applications that use Edit: proposed Wireshark patches |
The source argument should start with a '@', otherwise it is treated as actual source code instead of a filename. This is needed for luacov. See https://www.lua.org/manual/5.2/manual.html#lua_Debug lunarmodules/luacov#55 Change-Id: I0a3e2da65fb6b4aaabb9173a07fdea18a788f3e3 Reviewed-on: https://code.wireshark.org/review/29447 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
The "debug" logging function overwrites the "debug" package which breaks luacov: lunarmodules/luacov#55 Change-Id: I9b6025c060733198bfff8ea959444c09d6e08709 Reviewed-on: https://code.wireshark.org/review/29449 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
The source argument should start with a '@', otherwise it is treated as actual source code instead of a filename. This is needed for luacov. See https://www.lua.org/manual/5.2/manual.html#lua_Debug lunarmodules/luacov#55 Change-Id: I0a3e2da65fb6b4aaabb9173a07fdea18a788f3e3 Reviewed-on: https://code.wireshark.org/review/29447 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com> (cherry picked from commit 46e71f9) Reviewed-on: https://code.wireshark.org/review/29464 Reviewed-by: Peter Wu <peter@lekensteyn.nl>
The |
I have installed luacov (version 0.12.0-1) using luarocks. I am trying to use the same with a Wireshark Lua dissector plugin.
I have included the following in the top of the Lua dissector plugin:
I start Wireshark as follows:
But, the plugin fails to load with the message "~/.luarocks/share/lua/5.1/luacov/hook.lua:26:attempt to index global 'debug' (a function value)".
How to use luacov with Wireshark Lua plugins?
The text was updated successfully, but these errors were encountered: