Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lua Development Tools » ldt under ubuntu 12.04 64bit not running
ldt under ubuntu 12.04 64bit not running [message #874616] Mon, 21 May 2012 09:00 Go to next message
Volker Scheffold is currently offline Volker ScheffoldFriend
Messages: 8
Registered: May 2012
Junior Member
Hi,

after I installed ldt and tried to run it with:

lua -e "require('debugger')();"

I run into the following problems:

1.) lua: ./debugger.lua:155: Unable to determine the working directory.

After I fixed this, as I add the path hard into the program. I got the next error.

2.) lua: ./debugger.lua:1543: Cannot connect to 127.0.0.1:10000 : connection refused
stack traceback:
[C]: in function 'error'
./debugger.lua:1543: in function <./debugger.lua:1528>
(command line):1: in main chunk
[C]: ?

Does anyone has any idea?
Re: ldt under ubuntu 12.04 64bit not running [message #874629 is a reply to message #874616] Mon, 21 May 2012 09:23 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 152
Registered: July 2009
Location: Toulouse, France
Senior Member

Hi Volker,

Did you create -and launch- a debug configuration, prior to launching your script? See http://wiki.eclipse.org/Koneki/LDT/User_Guide#DBGP_Server

On a side note, what kind of Lua VM are you running? It seems weird that the debugger cannot figure out what your current working dir is. Cool that you figured out how to hardcode it though Smile
Re: ldt under ubuntu 12.04 64bit not running [message #874652 is a reply to message #874629] Mon, 21 May 2012 10:15 Go to previous messageGo to next message
Volker Scheffold is currently offline Volker ScheffoldFriend
Messages: 8
Registered: May 2012
Junior Member
Hi Benjamin,

the lua version is:

Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio

And when I run:

base_dir = os.getenv("PWD")

direct from the lua interactive shell it works.

Yes I created a debug configuration.

With IDE key: luaidekey
Timeout(s): 30
Local Resolution

But, am I right, I have first to start the debugger with lua -e "require('debugger')();" from the commandline, then I can use it in eclipse?
Re: ldt under ubuntu 12.04 64bit not running [message #874654 is a reply to message #874652] Mon, 21 May 2012 10:18 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 152
Registered: July 2009
Location: Toulouse, France
Senior Member

Volker Scheffold wrote on Mon, 21 May 2012 12:15
Hi Benjamin,
But, am I right, I have first to start the debugger with lua -e "require('debugger')();" from the commandline, then I can use it in eclipse?


Nope it is the other way around!
You first have to launch the debug config in Eclipse, it opens a debugging server and the script you later launch from the command line then connects to it!

If you feel it needs clarification in the documentation on the Wiki, feel free to update accordingly... Smile
Re: ldt under ubuntu 12.04 64bit not running [message #874661 is a reply to message #874654] Mon, 21 May 2012 10:26 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 152
Registered: July 2009
Location: Toulouse, France
Senior Member

One more thing, you should make sure to actually append the name of the script you want to debug, on your commandline ; for example:
lua -e "require('debugger')();" MyApp.lua

According to your previous messages, I am not sure you did that, and this might explain a few things Smile
Cheers!
Re: ldt under ubuntu 12.04 64bit not running [message #874688 is a reply to message #874661] Mon, 21 May 2012 11:18 Go to previous messageGo to next message
Volker Scheffold is currently offline Volker ScheffoldFriend
Messages: 8
Registered: May 2012
Junior Member
Hi Benjamin,

I have it now running.

I appended my lua application to the commandline already.

But the reason why I thougt it is the other way round was that when I try to start the debug configuration from eclipse I run into a timeout.

But that is no problem, the only thing I have to do is to start

lua -e "require('debugger')();" MyApp.lua

fast enough from the commandline, after I started the debug configuration.

Thank you very much for your help Smile

Volker
Re: ldt under ubuntu 12.04 64bit not running [message #874714 is a reply to message #874688] Mon, 21 May 2012 12:14 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin CabéFriend
Messages: 152
Registered: July 2009
Location: Toulouse, France
Senior Member

Volker Scheffold wrote on Mon, 21 May 2012 13:18
... is to start [...] fast enough from the commandline, after I started the debug configuration.


You can also increase the default timeout in the debug config settings Smile
Re: ldt under ubuntu 12.04 64bit not running [message #874766 is a reply to message #874714] Mon, 21 May 2012 14:03 Go to previous message
Volker Scheffold is currently offline Volker ScheffoldFriend
Messages: 8
Registered: May 2012
Junior Member
There is more than enough time to start lua -e "require('debugger')();" MyApp.lua.

But I waited every time for something like a success message after I started the debug config.

In the meantime I think I know why os.getenv("PWD") is not working. I think the reason is that when the command gets started from the program there is no $PWD variable in that context.

I changed now the line

base_dir = os.getenv("PWD")

to:

local file_name = debug.getinfo(1).short_src
local p = io.popen("dirname $(readlink -f " .. file_name .. ")")
if p then
base_dir = p:read("*l")
p:close()
end

which worked for me.
Previous Topic:install ldt
Next Topic:Debugging for Corona SDK
Goto Forum:
  


Current Time: Sun Nov 23 13:39:36 GMT 2014

Powered by FUDForum. Page generated in 0.02317 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software