Debugging lualatex [message #872475] |
Wed, 16 May 2012 07:38 |
uiy uiy Messages: 56 Registered: May 2012 |
Member |
|
|
Lualatex uses lua as a scripting engine(I think it is built in to the executable though). I develop all my lua code separately then add it in to lua because it is difficult to debug(have to use console printing).
By using the debugger scripts for the DBGT will/should it hook into the ldt and allow breakpoints and inspection?
[Updated on: Wed, 16 May 2012 07:39] Report message to a moderator
|
|
|
|
|
Re: Debugging lualatex [message #895736 is a reply to message #872983] |
Sun, 15 July 2012 15:00 |
uiy uiy Messages: 56 Registered: May 2012 |
Member |
|
|
I have now been able to succesfully debug lua code from a lualatex!!!!!!!!!!!!!!
Simply include the standard require debugger header in your tex(or lua code)
\directlua{require("debugger")()}
Add your breakpoints, start the debugger in the ldt, then compile the tex code, and debug like normal.
This should be a great boon for lualatex. It seems the recent updates have solved the problem(as I have done nothing different since the I posted these messages).
So far what I have noticed is that the lualatex global variables do not seem to show up in the inspector. e.g., I should see a tex variable in there somewhere but I can't find it. It is not difficult to get it in there by simply defining a local variable of it(local t = tex).
[Updated on: Sun, 15 July 2012 15:03] Report message to a moderator
|
|
|
|
Re: Debugging lualatex [message #895773 is a reply to message #895744] |
Sun, 15 July 2012 22:52 |
uiy uiy Messages: 56 Registered: May 2012 |
Member |
|
|
One issue seems to be the that one can't load external lua files and debug them. Trying to add a breakpoint to a lua file not in the project results in a null breakpoint added. (Well, normally it is Lua: <filename> [line: <line>] but in this case filename is shown as null which suggests it has an issue dealing with files)
When trying to actually debug I get the error:
Command breakpoint_set caused: (998) debugger.lua:880: attempt to index local 'uri' (a nil value)
Using module resolution doesn't change anything.
It seems when setting a breakpoint in the ldt it doesn't get the correct filename which then causes the debugger to break.
(I've noted that the breakpoints to not seem to store the absolute path which could be the real underlying issue. If I put the file into the current project it works as expected)
[Updated on: Sun, 15 July 2012 23:21] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03424 seconds