Require not resolved by Decoda?

cpalomocpalomo Join Date: 2009-10-29 Member: 69169Members
edited October 2009 in Decoda
Hi all,

Decoda seems not to be able to resolve <b>require</b> calls in Lua files in a very simple app.

C++ Source:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->/**
* @author   CESAR - cpalomo@tecgraf.puc-rio.br
* @brief    Simple test for decoda debugger: create Lua state, open libs, dofile and close state.
*/
extern "C" {
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
}
int main (int argc, char** argv)
{
  // create Lua state and open libs
  lua_State* L = lua_open();
  luaL_openlibs(L);
  // do lua file
  char luafile[] = "foo1.lua";
  if (luaL_dofile(L, luafile))
  {
    printf("Could not load file, aborting. Error: %s\n",lua_tostring(L,-1));
    return 1;
  }
  // close Lua state
  lua_close(L);
  return 0;
}<!--c2--></div><!--ec2-->
Lua files:

[foo1.lua]
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->print("entered foo1")
require "foo2"                            -- decoda should get to foo2.lua when F11 get pressed in this line
f_foo2()<!--c2--></div><!--ec2-->

[foo2.lua]
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->print("entered foo2")
function f_foo2()
  print("f_foo2 called")
end<!--c2--></div><!--ec2-->
Tested creating the application both in Visual Studio 2005 and 2008 with <b>pdb</b> creation. Decoda version 1.12 (build 1030).
Created a project in Decoda and added existing lua files to it. Using Lua 5.1.4.

My problem: debugging of the application starts (breakpoints in foo1.lua are reached), but when I get to the <b>require line</b> ( require foo2.lua ), I get the message "The source code for this script is not available...". Nor a breakpoint in foo2.lua is reached (since the source file is not recognized as belonging to the debug session).

By changing the VS project config so as not to generate the <b>pdb</b> file, F11 begins to work in the mentioned line: decoda nows seems to be able to resolve the file name at <b>require</b> call.
The big problem is that I need to debug both C++ and Lua simultaneously, so the <b>pdb</b> file is mandatory.

Am I missing something here? Does Decoda need any additional information to resolve correctly the <b>require</b> calls when using a <b>pdb</b> file?

Comments

Sign In or Register to comment.