[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Binary format of dumped code
- From: Tim Gogolin <tgogolin@...>
- Date: Thu, 12 Aug 2004 15:15:54 -0500
Well, I didn't get a reply to my post (Tue, Aug 10) about the
occasional lack of HOOKLINE calls when I would have expected them, but
I wanted folks to know that I've worked around that by using HOOKCOUNT
(count == 1), and looking at the currently executing activation
record's current line number... When that changes, then I must have
moved to a new line. Not elegant and certainly not speedy, but that is
not so important when debugging.
I have a different question if someone knows where to point me...
I've seen various references to desires for a lua-lint like behavior,
but the closest to an actual implementation I've found is Jay Carlson's
post (March 15, 2004) which contains a URL to a lualint executable.
If I wanted to write my own (or adapt other's efforts), I'd clearly
need an understanding of the lua byte code dumped format. I generally
understand the big ideas (i.e. GETGLOBAL, SETGLOBAL opcodes, etc), but
the integer parameters refer to a table of strings somewhere else in
the blob, and I don't know where they might be.
THE QUESTIONS:
1) Is there documentation on the lua 5 dump format? So far, the lua
distribution source code itself (ldump.c, lundump.c, lopcodes.h, lvm.c)
are all I've found. Has anyone written a paper (with diagrams?)
explaining the binary format of dumped code? If I have to trace
through ldump myself to get this understanding, would such a paper be
useful to others?
2) Has anyone written lualint like functionality where source code is
available?
--
Tim Gogolin