LuaD icon indicating copy to clipboard operation
LuaD copied to clipboard

lua stack trace

Open Trass3r opened this issue 15 years ago • 3 comments

Currently it only shows the error message (at least with LuaState.(doString|doFile)) A stack trace would be helpful.

Trass3r avatar Nov 22 '10 11:11 Trass3r

This used to be supported in the old LuaD. It's pretty easy to do, the question is how to nicely accommodate both the general case (doString/doFile with a custom error handler passed to pcall) and the most useful default behaviour (use debug.traceback).

LuaState also needs loadString and loadFile, returning LuaFunctions. If LuaFunction was given a general pcall method, there could be some overlap in the two solutions.

JakobOvrum avatar Nov 22 '10 11:11 JakobOvrum

Well, but what if the debug package shall not be exposed to the user?

Trass3r avatar Nov 22 '10 21:11 Trass3r

doString/doFile now use debug.traceback (merging with your fork earlier), but this function only exists if openLibs was called. I'd rather like to avoid a convoluted runtime check and instead redesign these functions so the user can easily choose what to do. Any ideas?

JakobOvrum avatar Aug 12 '11 03:08 JakobOvrum