lua-users home
lua-l archive

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


>----- Original Message -----
>From: petah
>Date: 3/12/2013 8:43 PM
>>>> Is it possible to get more structured information from a Lua error
>>>> callback than a "mangled" string generated by luaL_error()/lua_error()?
>>>>
>>> As far as I know, it's not.
>> Would there be some lua_State trickery to uniquely identify where luaL_error() was called from? Maybe some twisted native (machine language) stack walk? The daemon currently uses wxWidgets (base) so can use x-platform functions.
>>
>The Tilde debugger made by Tantalus adds an error hook to catch the 
>location where error() was called from.  It works pretty well:
>
>https://github.com/jjensen/lua-tilde/blob/master/lib/lua/lua_5.1.3.patch

Thx.

I develop mainly on Linux/CodeLite and only fire up Windows to check VC++ compatibility before commit (kicking and screaming:) so I just browsed the code / didn't run it / may be totally off:

I want to uniquely identify the different luaG_runerror() and luaL_error() invocations (~22 and 54, respectively) before they're flattened in a generic error string. From what I can tell Tilde doesn't accomplish that - am I correct?

I think the approx 76 fine-grained errors are differentiated by their 'fmt' strings where those two functions call va_start(argp, fmt).

cheers,

-- p