This is an idea that came up a few years ago when I realised we can't use the debug API in ComputerCraft (I was planning to use it for stack traces, something that's very useful when you're working on big projects). Fortunately that's not the case with xpcall, the heart of this utility program. It does what its name suggests; does a stack trace.
> trace -h Usage: trace [switches...] <program> [args...] Switches: -h show this message -l<FILE> log trace to <FILE> (append mode) -f show full trace (including bios.lua) -m<MAX> set max trace depth to <MAX> (there's no maximum by default) -b break trace into separate lines > cat deadbeef local function b() c() -- which is nil end local function a() b() end a() > trace deadbeef deadbeef:2: attempt to call nil stack trace: deadbeef:2 deadbeef:6 deadbeef:9
pastebin get zZkvWW4c trace
(Wow, this turned out to be an awfully short post)
Edited by LBPHacker, 10 September 2015 - 05:42 PM.