Evaluating Decoda - Can't debug my embedded code sample

bluntcoderbluntcoder Join Date: 2010-09-10 Member: 73965Members
edited September 2010 in Decoda
<div class="IPBDescription">An exception has been caught: - attempt to call a nil value</div>Hello,

I'm evaluating Decoda for our next game. It looks pretty sweet so far, but I can't seem to get the debugger working with my embedded Lua sample executable. I have a simple program written in C++ that simply reads in an add() function and executes it. Essentially this sample: <a href="http://gamedevgeek.com/tutorials/calling-lua-functions/" target="_blank">http://gamedevgeek.com/tutorials/calling-lua-functions/</a>

I read that I had to embed lua directly in the program, so instead of statically linking to a lua5.1.lib, I downloaded the lua 5.1.4 source and threw it into my program. I set my project settings to the following:

<b>Command: C:\Documents and Settings\marekm\My Documents\Visual Studio 2005\Projects\luadd\Debug\luaadd.exe
Command Arguments: [none]
Working Directory: C:\Documents and Settings\marekm\My Documents\Visual Studio 2005\Projects\luadd\Debug\</b>

When I run with debugging, I get the following error pop up.

<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro-->An exception has been caught: - attempt to call a nil value<!--colorc--></span><!--/colorc-->

If I use the release instead of the debug version, I get no pop up, but errors in the output:

<!--coloro:#FF0000--><span style="color:#FF0000"><!--/coloro--><!--coloro:#F4A460--><span style="color:#F4A460"><!--/coloro-->Warning 1004: Couldn't hook Lua function 'lua_newthread'
Warning 1000: Lua functions were not found during debugging session<!--colorc--></span><!--/colorc--><!--colorc--></span><!--/colorc-->

I'm using the latest Decoda with Lua 5.1.4. Sample program compiled with Visual Studio 2005 SP1 on Windows XP SP3.

Can anyone help me with this?

Comments

  • magicchicken0magicchicken0 Join Date: 2010-04-12 Member: 71362Members
    I had a problem with the missing lua functions too, which seemed to be from our linker optimization settings. It was eliminating functions or data that was never referenced (/OPT:REF switch in VS, which was only set in Release mode), and there's quite a few lua calls we were just never using ourselves.

    We threw in some extra dummy calls to the needed functions and the debugger could attach again.

    HOpe this helps
  • bluntcoderbluntcoder Join Date: 2010-09-10 Member: 73965Members
    edited September 2010
    Thanks for the tips. I tried removing the /OPT:REF and rebuilding, now Decoda just crashes the application when I try to run it (F5). But ideally I'd like to get it running in both Debug and Release modes.
Sign In or Register to comment.