|
|
Re: userdata types and detail formatter [message #1416911 is a reply to message #1416909] |
Tue, 28 May 2013 19:28 |
Julien Desgats Messages: 12 Registered: August 2011 |
Junior Member |
|
|
To be more precise about the above link, I massively refactored introspection part of the debugger to allow custom inspectors which cover exactly your needs.
Sadly, it is not yet documented: I started a tutorial but it is still WIP :cry:
If all your userdatas share the same metatable and you don't want to modify values from debugger implement it would be quite easy.
First you need the new debugger.lua[1] file, and then plug a simple inspector should look like (untested):
-- regular debugger bootstrap
require"debugger"("localhost", 10000)
-- add your inspector
local introspection = require "debugger.introspection"
introspection.inspectors[my_metatable] = function(name, value, parent, fullname)
-- just inspect your customized table instead of userdata
return introspection.inspect(name, my_converter(value), parent, fullname)
end
Look debugger source[2] for details, or this plugin[3] for LuaJIT cdata for an actual example.
Again, this is still WIP so please report any problem you may encounter.
About value modification from debugger, this is a problem that has not been fully addressed yet. Currently the debugger will set value with something like value["key"] = loadstring(new_value)(), so unless this is possible with your userdata objects, it will fail.
[1] gist.github.com/jdesgats/5383865/raw/56591f94f48a253a821a5610525b402206c3df96/debugger.lua
[2] github.com/jdesgats/org.eclipse.koneki.ldt/blob/newintrospection/libraries/luadbgpclient/debugger/introspection.lua
[3] github.com/jdesgats/org.eclipse.koneki.ldt/blob/newintrospection/libraries/luadbgpclient/debugger/plugins/ffi/init.lua
|
|
|
|
Powered by
FUDForum. Page generated in 0.02962 seconds