Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Koneki » How to set remote system for remote debug(ldt;remote;)
How to set remote system for remote debug [message #1226964] Fri, 03 January 2014 02:11 Go to next message
json nicolas is currently offline json nicolas
Messages: 3
Registered: January 2014
Junior Member
I am a newer for lua, and now i need remote development and remote debug.
in win7, i installed ldt and remote development supoort. i want to debug my helloworld in the remote system redhat 5.4.
in redhat, i just installed lua5.1.4 and luarocks.
ssh connection is ok. i run the helloworld, it can be transfered to the redhat, but launch had some problems.in the console of ldt , the output is "bash: lua: command not found".
when i debugged the helloworld, got the followed error:
exception occurred during launch
reason: Debugger process was unexpectedly terminated

i am not sure what i have done is correct.
please give the steps Written very detailed .
i saw : http://wiki.eclipse.org/Koneki/LDT/Developer_Area/User_Guides/User_Guide_1.0#Remote_session
but still have no idea about remote development and remote debug.

any help is appreciative.
Re: How to set remote system for remote debug [message #1227765 is a reply to message #1226964] Sun, 05 January 2014 08:59 Go to previous messageGo to next message
li meng is currently offline li meng
Messages: 7
Registered: January 2014
Junior Member
I also have the same problem, please give a solution to it. I was running on the LUA script ARM, I want use LUA remote to debug it, they reported "the Debugger process was unexpectedly terminated" error, I feel there is no other place to set up problems.

The same i reference "Remote session" of "LDT User Guide" to set my environment.

Thank you.
Re: How to set remote system for remote debug [message #1228012 is a reply to message #1226964] Mon, 06 January 2014 02:47 Go to previous messageGo to next message
json nicolas is currently offline json nicolas
Messages: 3
Registered: January 2014
Junior Member
i use followed code:
require('debugger')("172.16.14.13", 10000, 'luaidekey');
for remote debug.
i got the different errors:
lua: ./debugger.lua:1455: closed
stack traceback:
[C]: in function 'assert'
./debugger.lua:1455: in function 'debugger_loop'
./debugger.lua:1574: in function <./debugger.lua:1527>
main.lua:4: in main chunk
[C]: ?

i checked http://www.eclipse.org/forums/index.php/t/274092/, but can't understand.
anyone have some idea about this error?
Re: How to set remote system for remote debug [message #1228082 is a reply to message #1228012] Mon, 06 January 2014 06:16 Go to previous messageGo to next message
Simon Bernard is currently offline Simon Bernard
Messages: 164
Registered: July 2009
Senior Member
Hi,

We have some problems with user environment variables and remote lua application. That's why sometime lua command is not found or LUA_PATH and LUA_CPATH is not set correctly.

You should avoid this by setting your lua executable path and environment variables at LDT side.

To do that : click on the ssh Lua node of your system. (in Remote System Explorer perpective)

In the properties view, click on show advanced properties button. Now you should see
Lua Command, LUA_PATH, LUA_CPATH and LD_LIBRARY_PATH in the view.
Set the value corresponding to your remote system (try with absolute path to be sure).

HTH
Simon
Re: How to set remote system for remote debug [message #1228097 is a reply to message #1228012] Mon, 06 January 2014 07:03 Go to previous messageGo to next message
li meng is currently offline li meng
Messages: 7
Registered: January 2014
Junior Member
HI,

I hope who can explain the meaning of these items:
LD_LIBRARY_PATH
Lua Command lua
Lua CPath
Lua Path
Output Directory /tmp

Also, I installed installed lua5.1.4 and luarocks, I want to debug a file, such as Hello.lua (not main, such as only a fuction), I am in the LDT remote mode, do not add require ("debugger") () in front, on the other side (routers) do not have to install luarocks, and require ("debugger") () can be debugged, is that right?
Re: How to set remote system for remote debug [message #1228345 is a reply to message #1226964] Mon, 06 January 2014 21:03 Go to previous messageGo to next message
json nicolas is currently offline json nicolas
Messages: 3
Registered: January 2014
Junior Member
thanks you, Simon.
you are right, remote debug of ldt works well now.
to set the properties of ssh lua node is necessary.
what i set as followed:
LD_LIBRARY_PATH:
Lua Command : /usr/local/bin/lua
Lua CPath: /usr/local/lib/?.a;/usr/local/lib/lua/5.1/?.so
Lua Path: ./?.lua;/usr/local/bin/?;/usr/local/share/lua/5.1/?.lua
Output Directory: /tmp
in addtion, i install a packet luasocket-2.0.2 from **http**://files.luaforge.net/releases/luasocket/luasocket.
Hope this is helpful for others.
i want to debug lua project in android though by usb connection. anyone have some idea?
thanks again.
Re: How to set remote system for remote debug [message #1228455 is a reply to message #1228345] Tue, 07 January 2014 04:15 Go to previous messageGo to next message
li meng is currently offline li meng
Messages: 7
Registered: January 2014
Junior Member
HI
I use openwrt router,
in my Environment Variables, not any of
LD_LIBRARY_PATH
Lua Command lua
Lua CPath
Lua Path
Output Directory /tmp

it just only have
root@admin:/# env
USER=root
OLDPWD=/
HOME=/root
SSH_TTY=/dev/pts/0
PS1=u@\h:\w\$
LOGNAME=root
TERM=xterm
PATH=/bin:/sbin:/usr/bin:/usr/sbin
SHELL=/bin/ash
PWD=/
SSH_CONNECTION=193.168.1.230 55175 193.168.1.1 22

I have luasocket in my router and

Then, How can i do?
Re: How to set remote system for remote debug [message #1228563 is a reply to message #1228455] Tue, 07 January 2014 09:01 Go to previous messageGo to next message
Simon Bernard is currently offline Simon Bernard
Messages: 164
Registered: July 2009
Senior Member
hi li meng,

It seems you misunderstood my point.
You should configure the environment variables in LDT(eclipse) UI.
In the Remote System Explorer perpective :
https://wiki.eclipse.org/images/1/14/RemoteConnection.png


Re: How to set remote system for remote debug [message #1228750 is a reply to message #1228563] Tue, 07 January 2014 19:34 Go to previous messageGo to next message
li meng is currently offline li meng
Messages: 7
Registered: January 2014
Junior Member
Thank you, I find the path, and then later set LDT, do not have this problem, but now have a new problem, it seems some people appeared. configure LDT environment, this is really a complex task Smile

And I see my router a few more files, such as debugger.lua, in LDT_Debug dir, indicating the success of the communications

The problem is:
Process "LDT_Debug" takes too long to connect to IDE...
Re: How to set remote system for remote debug [message #1228897 is a reply to message #1228750] Wed, 08 January 2014 04:54 Go to previous messageGo to next message
Simon Bernard is currently offline Simon Bernard
Messages: 164
Registered: July 2009
Senior Member
Are you sure your path is correctly set ?
This could occured if the debugger.lua file does not succeed to connect to IDE.

Firstable, you should test your configuration without using debug. Try to just launch a "Run".
If it's ok, now try to do a run with a require 'socket' at the beginning of the file.
Re: How to set remote system for remote debug [message #1228970 is a reply to message #1228897] Wed, 08 January 2014 07:54 Go to previous messageGo to next message
li meng is currently offline li meng
Messages: 7
Registered: January 2014
Junior Member
HI,Simon Bernard
I think i set right path

I tried it your way,
LDT report:
/usr/bin/lua: controller/admin/system.lua:16: attempt to call a boolean value
stack traceback:
controller/admin/system.lua:16: in main chunk
[C]: ?

I don't what to do.

More info is below:

Router:
1, luasocket version:2.0.2, it's work
2, Lua Path /usr/lib/lua/luci/controller/admin/system.lua(i only set be debug file, because so much files and some name is same)

3, here is some file content of system.lua
...
$Id: system.lua 9570 2012-12-25 02:45:42Z jow $
]]--
module("luci.controller.admin.system", package.seeall)

line 16(In fact there is no content)
function index()
entry({"admin", "system"}, alias("admin", "system", "system"), _("System"), 30).index = true
...

PC:
1, luasocket version:3.0, it's work
2, .lua path /lucsrc/luci/controller/admin/system.lua
3, here is some file content of be debug system.lua
$Id: system.lua 9570 2012-12-25 02:45:42Z jow $
]]--
require('socket')
require('debugger')();--i add right environment variable.
module("luci.controller.admin.system", package.seeall)
line 18(In fact there is no content)
function index()
entry({"admin", "system"}, alias("admin", "system", "system"), _("System"), 30).index = true
...
Re: How to set remote system for remote debug [message #1229224 is a reply to message #1228970] Wed, 08 January 2014 19:45 Go to previous messageGo to next message
li meng is currently offline li meng
Messages: 7
Registered: January 2014
Junior Member
i try a sample:
require('socket')
require('debugger')();
function test()
print"hello limeng"
local i = 100
print (i)
end
test()

use "RUN", it's report:
hello limeng
100
hello limeng
100
/usr/bin/lua: test.lua:2: attempt to call a boolean value
stack traceback:
test.lua:2: in main chunk
[C]: ?

it's set LUA_CPATH wrong?

bug i find all *.so and add to LUA_CPATH.
Re: How to set remote system for remote debug [message #1229287 is a reply to message #1229224] Thu, 09 January 2014 00:18 Go to previous message
li meng is currently offline li meng
Messages: 7
Registered: January 2014
Junior Member
ROUTER:
root@admin/# cat lua test.lua
require('socket')
function test()
print"hello limeng"
local i = 100
print (i)
end
test()

root@admin/# lua test.lua
hello limeng
100

PC:use 'RUN' at LDT
err:
/usr/bin/lua: test.lua:1: module 'socket' not found:
no field package.preload['socket']
no file '/usr/bin/socket'
no file '/tmp/openwrt_system_193.168.1.1/socket.lua'
no file '/tmp/openwrt_system_193.168.1.1/socket/init.lua'
no file '/lib/socket.so'
no file '/lib/lua/socket.so'
no file '/usr/lib/socket.so'
no file '/usr/lib/lua/socket.so'
no file '/usr/lib/lua/mime/socket.so'
no file '/usr/lib/pppd/2.4.5/socket.so'
stack traceback:
[C]: in function 'require'
test.lua:1: in main chunk
[C]: ?

I find some *.so have Extension name,
Such as 'socket.so.2.0.2'

Previous Topic:Metalua integration with LDT
Next Topic:LuaDocumentor help please
Goto Forum:
  


Current Time: Wed Jul 30 05:09:19 EDT 2014

Powered by FUDForum. Page generated in 0.02548 seconds