lua-users home
lua-l archive

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

steve donovan wrote:
> Seeing as LJ is already tracing all Lua calls that are executed, could
> it not have an option to export this information in a form that would
> facilitate code browsing? This is a common problem when familiarizing
> oneself with a large code base.  From static analysis, it is
> practically impossible to know what code paths are implied by the
> simple call 'obj:method()'

Well, yes, but it only shows the hot paths. Try -jdump=b and watch
the traced bytecode on a non-trivial example.

> The exact format is not important, only that it is parseable ;)

Even better: the VM has full introspection -- the dump module is
written in pure Lua. Look at the dump_record() function. Simply
hook into the "record" vmhook yourself and collect whatever info
you need about the executed code.