Debugging lua with c++ simultanously
In my project i am calling lua scripts from c++ code. I want to debug lua and c++ simultanously. Can anybody help me?
For example this is my c++ code
#include <stdio.h>
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
/* the Lua interpreter */
lua_State* L;
int main ( int argc, char *argv[] )
{
/* initialize Lua */
L = lua_open();
/* load Lua base libraries */
luaL_openlibs(L);
/* run the script */
luaL_dofile(L, "test.lua");
/* cleanup Lua */
lua_close(L);
/* pause */
printf( "Press enter to exit..." );
getchar();
return 0;
}
And this is my lua code meta.lua
x=5
y=4
function add(x,y)
return x+y
end
k=add(x,y)
print (k.." sonuc")
For example this is my c++ code
#include <stdio.h>
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
/* the Lua interpreter */
lua_State* L;
int main ( int argc, char *argv[] )
{
/* initialize Lua */
L = lua_open();
/* load Lua base libraries */
luaL_openlibs(L);
/* run the script */
luaL_dofile(L, "test.lua");
/* cleanup Lua */
lua_close(L);
/* pause */
printf( "Press enter to exit..." );
getchar();
return 0;
}
And this is my lua code meta.lua
x=5
y=4
function add(x,y)
return x+y
end
k=add(x,y)
print (k.." sonuc")
Comments
But my problem is that; when ı start to debug from decoda side, it starts to run until where ı called lua file then it says :
"This application requested the Runtime to terminate it unusual way. Please contact with application's support team for more information"
And Visual Studio gives an error:Unable to attach to the crashing process. The requested operation is not supported.
How can I solve the problem
I want to debug lua and c++ at the same time. is it possible???
For example ı wanna put breakpoint into c++ and lua.
when i debug from decoda ı want it to stop at the breakpoint where ı put in c++.