lua-users home
lua-l archive

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

Hi Petr,

Don't know your exactly problem, but in our case (working with VisualStudio and ARM based devices too) the following code snippet helped much for similar problems:

-- main.lua starts here

function run()
    print( "Initialization of application script started ..." )

    -- application code
    print( "Initialization of application script ready" )

-- main entry point for our application.
-- calls first parameter as function
local err, msg = xpcall( run, debug.traceback )

if not err
    print( "*** " .. tostring( msg ) )

-- main.lua ends here

Hope this helps a little bit.

Best Regards

Petr Štetiar schrieb:
Bester Husselmann <> [2008-11-04 12:07:14]:

Hello there,


I am building a C++ application for Windows CE (ARM-based processor) and am running into a peculiar problem. When Lua is mistreated, e.g.:

I use Lua on various Windows CE/Mobile/Pocket PC devices for more like 3 years
now and I've never had any problems with Lua itself. It's OS issues always.

   lua_pushnumber(L, 1);
   lua_pushstring(L, NULL); // Shouldn't work, should it?
   lua_settable(L, -3);

it does not give an exception, doesn't give an error via the lua_atpanic function, and doesn't output anything to the console.

Try to change atpanic() to use MessageBox() instead of that fprintf(), or try
regular file instead of that stderr.

application exits (again, without any error) and the output window in Visual Studio shows a Data Abort exception, which is apparently an ARM-specific processor-level exception. These also happen when I try to call a function that doesn't exist to concatenate its result to a string, e.g.

   log("The string is: " .. some_nonexistant_function("bob"))

Maybe if you provide minimal test case with complete source code, somebody
might be able to help you more.

Can anyone give me a pointer (pun not intended, I swear) towards what to do to get some detailed error reporting?

Compile Lua stand-alone interpreter(lua.c) for Windows CE and try to run your
log() test case there. If it's working as you've expected, then you can
cherry-pick Lua error reporting code in docall() function to your C++ application.

-- ynezz