Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lua Development Tools » Debugging not working(Debugging problems)
Debugging not working [message #775935] Sat, 07 January 2012 00:40 Go to next message
Milind Gupta is currently offline Milind Gupta
Messages: 26
Registered: January 2012
Junior Member
Hi,
I tried setting up the debug configuration as mentioned in the user guide but when I click debug I get the following message:

Process "LDT_Debug" takes too long to connect to IDE...

I had downloaded and placed the debugger.lua and the other file in the project src directly itself.

Please let me know what am I missing here.

Thanks,
Milind
Re: Debugging not working [message #776034 is a reply to message #775935] Sat, 07 January 2012 08:26 Go to previous messageGo to next message
Milind Gupta is currently offline Milind Gupta
Messages: 26
Registered: January 2012
Junior Member
Another thing I see is that the auto complete doesn't work. For example if I type for on a line it will display a cross on the line beginning saying it cannot determine the error...
Re: Debugging not working [message #776885 is a reply to message #775935] Mon, 09 January 2012 13:07 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin Cabé
Messages: 151
Registered: July 2009
Location: Toulouse, France
Senior Member

Hi Milind,
How are you launching your Lua script?
If debugger.lua and debugintrospection.lua are next to your main file (in my case, it is main.lua), then you should be able to launch your debug session with the following command line (assuming that you haven't change any of the default settings of the launch configuration):

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

Maybe you simply missed the fact you have to launch the application by yourself. It might look a bit counterintuitive, but the rationale behind this is that most embedded developers have their own way to launch their stuff, usually from a remote target, etc.

Hope this helps...
Re: Debugging not working [message #776898 is a reply to message #776034] Mon, 09 January 2012 13:34 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin Cabé
Messages: 151
Registered: July 2009
Location: Toulouse, France
Senior Member

Milind Gupta wrote on Sat, 07 January 2012 09:26
Another thing I see is that the auto complete doesn't work. For example if I type for on a line it will display a cross on the line beginning saying it cannot determine the error...


Weird... Confused Could you please check if there's more information available via the "Error Log" view? That would certainly help identify where the problem could be. Thanks!
Re: Debugging not working [message #777075 is a reply to message #776898] Mon, 09 January 2012 19:53 Go to previous messageGo to next message
Milind Gupta is currently offline Milind Gupta
Messages: 26
Registered: January 2012
Junior Member
Hi Benjamin,
Thanks a lot for your reply. How do I get the Error Log view? I also later placed the debugger.lua and debugintrospection.lua in the lua path. But I am always trying through the Eclipse IDE I never did anything from the command prompt.

So do I have to launch my main.lua with the command:

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

and then go to the Eclipse IDE and launch the debug configuration?

I also saw the video of LDT so was just trying to follow that since it did not show anything through the command line I missed that.

Please let me know, I will try further tonight.

Thanks,
Milind
Re: Debugging not working [message #777127 is a reply to message #777075] Mon, 09 January 2012 22:37 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin Cabé
Messages: 151
Registered: July 2009
Location: Toulouse, France
Senior Member

Milind Gupta wrote on Mon, 09 January 2012 20:53

How do I get the Error Log view?


From the Window>Show View>Other... menu. There might be (not sure though) an entry corresponding to the error you encoutered when trying to use autocomplete. If it is the case, that would be great if you could file the error details as a new bug against Koneki, here: https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Koneki&component=LuaTools Smile

Quote:

I also later placed the debugger.lua and debugintrospection.lua in the lua path. But I am always trying through the Eclipse IDE I never did anything from the command prompt.

So do I have to launch my main.lua with the command:

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

and then go to the Eclipse IDE and launch the debug configuration?


It's the other way around: you first launch the debug configuration and behind the scenes, it will start the debug server that your application will then connect to as soon as you'll run the command you mention. If both the debug Lua files are in your Lua PATH or next to main.lua, and LuaSocket also is in your Lua path, you should be good to go!
If you try to launch your main.lua in debug mode and haven't launched the debug configuration beforehand, it won't go very far since your debug "client" won't find any server to connect to.

Quote:

I also saw the video of LDT so was just trying to follow that since it did not show anything through the command line I missed that.


This is indeed something that might be confusing, sorry about that. We will try to post an updated screencast to fix this.

Cheers!
Re: Debugging not working [message #871418 is a reply to message #777127] Sun, 13 May 2012 15:05 Go to previous messageGo to next message
tim scott is currently offline tim scott
Messages: 6
Registered: May 2012
Junior Member
I want to start learning lua and figured I'd give LDT a shot. I've used Eclipse for a while now and am pretty familiar with Java development. Anyway, I'm running into problems trying to get the debugger working. Here's what I'm running into:

1) I've created a debug configuration and launch it.
2) I then try to run my "Hello World" lua app using an External Tools config, but it terminates immediately with the following error:
D:\lua\5.1\lua.exe: .\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:1: in main chunk
	[C]: ?


Here's the code:
require("debugger")()

local function main()
	print("Hello world")
end
main()


I'm running the standalone LDT on a Win7 x64 platform, if that helps.

I thought it might be a socket thing. As far as I can tell, I have the LuaSocket installed:

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> socket=require("socket")
> print(socket._VERSION)
LuaSocket 2.0.2


If I comment out the 'require("debugger")' line and just do a run of the same code, I see "Hello world" as expected.

I've also tried to follow Thijs' blog post on debugger setup but encounter the same issue.

Thanks,
--tim
Re: Debugging not working [message #871419 is a reply to message #871418] Sun, 13 May 2012 15:13 Go to previous messageGo to next message
tim scott is currently offline tim scott
Messages: 6
Registered: May 2012
Junior Member
Ok. Well. I feel foolish.

It works. After posting my description above, I closed out LDT and also went to close out an instance of Eclipse I had running. I was surprised to see a bunch of debugger error dialogs associated with the Eclipse instance. It turns out that running both of these tools simultaneously causes issues for the debugger. Who knew?

I'm now debugging successfully. Hopefully this helps someone else out there.

--tim
Re: Debugging not working [message #871422 is a reply to message #871419] Sun, 13 May 2012 15:35 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin Cabé
Messages: 151
Registered: July 2009
Location: Toulouse, France
Senior Member

Hey Tim!

Quote:
After posting my description above, I closed out LDT and also went to close out an instance of Eclipse I had running. I was surprised to see a bunch of debugger error dialogs associated with the Eclipse instance. It turns out that running both of these tools simultaneously causes issues for the debugger. Who knew?


Can you give more details about this other Eclipse instance that you had running? Was LDT installed there too? Or maybe another DLTK based tool (Ruby or PHP tooling maybe...)?

Anyway, I am glad that you finally managed to have the debugger working Smile Feel free to give feedback on your overall experience with LDT!

Cheers!
Re: Debugging not working [message #871436 is a reply to message #871422] Sun, 13 May 2012 17:11 Go to previous messageGo to next message
tim scott is currently offline tim scott
Messages: 6
Registered: May 2012
Junior Member
Bejamin,

Thanks for the quick response! Good to see this project is active!

Sure, I can share Eclipse instance info. This problem is very reproducible:

1) Start-up my Eclipse instance. I do Android development using this. Here's what the Help > About says:

Eclipse SDK

Version: 3.6.2
Build id: M20110210-1200


2) Start-up the standalone LDT tool.

3) Open up workspace & Lua project. Lua project contains main.lua, debugger.lua, and debugintrospection.lua.

require("debugger")()

local function main()
	print("Hello world")
end
main()


4) Start the debugger in LDT.

5) Use the external tool configuration for lua_run with main.lua selected from the project. (See Thisj's blog post for the config I'm using... I'd post a link, but my post count is < 25 and I'm currently disallowed from doing that... stupid spammers.)

6) A pop-up dialog appears *under* the Eclipse instance on my Win7 box. That's partly why I missed it earlier when I was trying to get things going -- I didn't even see the dialog appear. The dialog title is "Debugger Error" and the contents are "Incompatible debugger version. The remote debugger version might not match the expected protocol version (2006040705)."

7) As mentioned in my previous post, I see the following error in the console of the LDT:

D:\lua\5.1\lua.exe: .\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:1: in main chunk
	[C]: ?


Further-- I figured I'd try to load the Eclipse plugin for LDT in my Eclipse installation. That fails a dependency check relating to PHP, so no go there. This is too bad -- I want to execute Lua scripts from my Android app (at least... that's the plan -- I'm still learning Lua). If I have to run the tools separately, that's going to be a pain.

Here's what's reported with the dependency check issue if I try to install LDT directly in my Eclipse instance:

Cannot complete the install because of a conflicting dependency.
  Software being installed: Lua Development Tools (Incubator) 0.8.0.201204241228 (org.eclipse.koneki.ldt.feature.group 0.8.0.201204241228)
  Software currently installed: PHP Development Tools (PDT) SDK Feature 2.2.1.v20101001-2300-53184QAN4JBQgLYPWMLcXn6Na9Od (org.eclipse.php.sdk.feature.group 2.2.1.v20101001-2300-53184QAN4JBQgLYPWMLcXn6Na9Od)
  Only one of the following can be installed at once: 
    Dynamic Languages Toolkit Core 2.0.0.v20100603-0936 (org.eclipse.dltk.core 2.0.0.v20100603-0936)
    Dynamic Languages Toolkit Core 3.0.1.v20110823 (org.eclipse.dltk.core 3.0.1.v20110823)
    Dynamic Languages Toolkit Core 2.0.1.v20100806-1245 (org.eclipse.dltk.core 2.0.1.v20100806-1245)
  Cannot satisfy dependency:
    From: Dynamic Languages Toolkit - Core Frameworks 2.0.0.v20100518-1923-7L--EAAoOVMSMc4AWEvJ (org.eclipse.dltk.core.feature.group 2.0.0.v20100518-1923-7L--EAAoOVMSMc4AWEvJ)
    To: org.eclipse.dltk.core [2.0.0.v20100603-0936]
  Cannot satisfy dependency:
    From: Dynamic Languages Toolkit - Core Frameworks 2.0.0.v20100518-1923-7L-0EAAoOVMSUaEAZ8w_ (org.eclipse.dltk.core.feature.group 2.0.0.v20100518-1923-7L-0EAAoOVMSUaEAZ8w_)
    To: org.eclipse.dltk.core [2.0.1.v20100806-1245]
  Cannot satisfy dependency:
    From: Lua Development Tools (Incubator) 0.8.0.201204241228 (org.eclipse.koneki.ldt.feature.group 0.8.0.201204241228)
    To: org.eclipse.dltk.core 3.0.0
  Cannot satisfy dependency:
    From: PHP Development Tools (PDT) Runtime Feature 2.2.1.v20101001-2300-7L7J1F8NcJTJTJJT9cmJJ (org.eclipse.php.feature.group 2.2.1.v20101001-2300-7L7J1F8NcJTJTJJT9cmJJ)
    To: org.eclipse.dltk.core.feature.group [2.0.0,3.0.0)
  Cannot satisfy dependency:
    From: PHP Development Tools (PDT) SDK Feature 2.2.1.v20101001-2300-53184QAN4JBQgLYPWMLcXn6Na9Od (org.eclipse.php.sdk.feature.group 2.2.1.v20101001-2300-53184QAN4JBQgLYPWMLcXn6Na9Od)
    To: org.eclipse.php.feature.group [2.2.1.v20101001-2300-7L7J1F8NcJTJTJJT9cmJJ]


I don't do any PHP development, so I'm not sure what is up with that. I'd move to the latest version of Eclipse, but everything is *working* for me now, and I'm paranoid of breaking my Android builds. Razz

Thanks again,
--tim
Re: Debugging not working [message #871654 is a reply to message #871436] Mon, 14 May 2012 16:22 Go to previous message
Simon Bernard is currently offline Simon Bernard
Messages: 286
Registered: July 2009
Senior Member
Hi Tim,
I think I have an explanation :

By default, LDT(DLTK to be more accurate) uses the port 10000 for debugging, but if this port is busy, it will try another (e.g. 10001). You can also set the port manually as you could see in the documentation.

So, I suppose your first eclipse instance uses the port 10000.
And so when you run require("debugger")(), you try to connect to your first instance which answers something like ""Incompatible debugger version. The remote debugger version..." and closes the socket.
When you start the attach debug launch configuration you can see the port used by LDT.

http://wiki.eclipse.org/images/f/f6/DebugView.png

If it's not 10000, you must indicate it when you run your application :
 require('debugger')("localhost","10001")

HTH
Previous Topic:Error when saving files
Next Topic:Is Koneki defunct?
Goto Forum:
  


Current Time: Wed Oct 01 10:18:49 GMT 2014

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

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