step into LUA script from within C program

200 views
Skip to first unread message

whatscookin

unread,
Nov 6, 2008, 12:10:09 AM11/6/08
to scite-interest
Hi All,

I am trying to step into a LUA script (using gdb) which is being
called from within C program i.e. the C programs invokes the LUA
script. Now, the machine on which the lua and C program resides does
not support any GUI. I tried using clidebug that comes with scite-
debug using the instructions given here: http://lua-users.org/wiki/SciteDebug
under section “Integrated Lua and C/C++ debugging”


I did the following:

1) copied gscite folder (after extraction) to /root/ (as I am logged
in as root)


2) created .SciTEUser.properties and added the following to it

ext.lua.startup.script=/root/gscite/scite-debug/extman.lua

debug.target=[n]:gdb;/usr/local/xyz/bin/c_executable[h];<path to
script_to_debug.lua >


3) added the following in my lua script (script_to_debug.lua)

local path = ';/root/gscite/{{scite-debug}}/lua_clidebugger/?.'

package.path = package.path .. path .. 'lua'

package.cpath = package.cpath .. path .. 'so'

WIN=false

GDB=true

require "debugger"

io.stdout:setvbuf("no")

pause('debug')


and copied /root/gscite/scite-debug/lua_clidebugger/debugger.lua to
the dir containing script_to_debug.lua (otherwise require “debugger”
won’t work)


4) ran gdb <path to c_exe> <pid of exe> and added breakpoint at a
function inside script_to_debug.lua

But gdb doesn’t step into script_to_debug.lua.



Please help me out in as to how to proceed ?

Do I have to add script_to_debug.lua symbols to gdb and how to do
it?

Do I need to run clidebug as a process within gdb and how?

Or something else is to be done for this scenario?



Any help would be deeply appreciated. Thanks in advance.



Regards

Tolstoy

whatscookin

unread,
Nov 6, 2008, 12:10:09 AM11/6/08
to scite-interest
Reply all
Reply to author
Forward
0 new messages