Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Lua Development Tools » Debugging for Corona SDK(Is it possible to debug applications built using the Corona SDK?)
Debugging for Corona SDK [message #815322] Wed, 07 March 2012 14:06 Go to next message
Jarrod Bellmore is currently offline Jarrod Bellmore
Messages: 6
Registered: March 2012
Junior Member
I have been recently looking into doing cross platform game development for mobile platforms using the Lua based Corona SDK. The Koneki plugin for Eclipse looks absolutely fantastic and I would love to be able to use it to develop and debug Corona SDK games.

I am fairly new to both Corona as well as Lua (been developing in other languages and platforms for years) so I am slowly putting all the pieces together. One thing I have not been able to find is a great (visual) debugging tool that can work with the Corona SDK simulator. They have a command line debugger, which to the best of my knowledge is based on RemDebug but is a closed source custom version of it, and that will work but can really slow down the development progress having to rely on a command line debugger.

I do not know all of the specifics of Lua debugging using remote debugging but has anyone gotten the remote debugging capabilities of Koneki to work the Corona simulator? Should the steps mentioned in the Remote Debugging section (3.1) of the user guide work for games running within the Corona simulator?

If anyone has gotten it to work, what were the steps required to get it setup?

Hopefully that all made sense...

Thanks!
Re: Debugging for Corona SDK [message #815461 is a reply to message #815322] Wed, 07 March 2012 17:43 Go to previous messageGo to next message
Nicholas Green is currently offline Nicholas Green
Messages: 2
Registered: March 2012
Junior Member
+1

Looking for the same thing. I've been doing a lot of Actionscript development in the last couple years and switching back to command-line feels kluge and slow.
Re: Debugging for Corona SDK [message #815698 is a reply to message #815461] Thu, 08 March 2012 00:21 Go to previous messageGo to next message
Jarrod Bellmore is currently offline Jarrod Bellmore
Messages: 6
Registered: March 2012
Junior Member
Well I have made some progress in this and it appears debugging IS possible, at least somewhat. Basically what I have working so far is the ability to set breakpoints, step into methods (including in other lua files other than main.lua) and view simple (non table) variable's values in the variables windows within Eclipse. Unfortunately it looks like expanding a table is not going to be possible as the Corona SDK has a sandboxed Lua environment that does not include the loadstring() method, which apparently the debugger uses to retrieve the keys and values from tables. Whenever I try to expand a table in the variables window I get the following message in the console:

ERROR: loadstring() is not available in Corona

Note that I am running the game using the Corona SDK Simulator and not the debugger they provide, so perhaps they allow loadstring() in the debugger? I tried to load it up using the debugger and the debugger just hangs so maybe I am missing something? Not sure if there is a name collision with the built in Corona debugger and the debugger being used by Koneki? I might try to rename the Koneki debugger module and see if that works.

If I get some time tonight or tomorrow I will try to put a guide together for you to show how I got it setup.
Re: Debugging for Corona SDK [message #815705 is a reply to message #815698] Thu, 08 March 2012 00:37 Go to previous messageGo to next message
Jarrod Bellmore is currently offline Jarrod Bellmore
Messages: 6
Registered: March 2012
Junior Member
Well another update, apparently I was just being thick and forgot to realize that when the Corona debugger starts up, it pauses on the first line of the main lua file! As soon as you tell that to continue the game loads in the simulator just fine. I am happy to report good news, the variables window can now drill into the table values properly!

I will definitely put together a little tutorial for how I got this setup and working. I would also just like to take this time to say that Koneki is great and I am so happy that I found it! Major props to the creators and contributors...
Re: Debugging for Corona SDK [message #819132 is a reply to message #815705] Mon, 12 March 2012 14: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

Hi Jarrod,

Thanks so much for the kind words!
Actually I tried to play with Corona a while ago, and I was stuck with the loadstring() problem too. I didn't try to use the debugger VM, but indeed it seems to be working great. In case you don't know, not only it allows you to browse tables contents, but it also permits to define conditional breakpoints (i.e. halt only when a given expression evaluates to true)! Just right-click on a given breakpoint and select the menu entry "Breakpoint Properties..." in order to change the breakpoint behaviour.

That would be awesome if you could write a quick debug tutorial, and very helpful to the Corona community! Please keep us posted here when you'll have done it, I'll be happy to relay it on Koneki website too.


On a side note, you should check out the beta version of LDT mentioned here to get better support (i.e. content assist) for Corona SDK!

Cheers,
Ben.

[Updated on: Mon, 12 March 2012 14:38]

Report message to a moderator

Re: Debugging for Corona SDK [message #835670 is a reply to message #815322] Tue, 03 April 2012 14:26 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 Jarrod,

Any chance that you had time to put up some kind of debugging tutorial for Corona, as you mentioned earlier in this thread? Anything I could do to help?

This would fit along nicely with this recent video! Cool
Re: Debugging for Corona SDK [message #840143 is a reply to message #835670] Mon, 09 April 2012 18:16 Go to previous messageGo to next message
Gregory Chandran is currently offline Gregory Chandran
Messages: 4
Registered: April 2012
Junior Member
Hi Jarrod, Anyone,

I managed to setup koneki and eclipse and am wondering if we can debug remotely using corona debugger? did you manage to set this up? If not, how would I go about developing in corona, using the same setup?
Re: Debugging for Corona SDK [message #840144 is a reply to message #815322] Mon, 09 April 2012 18:16 Go to previous messageGo to next message
Gregory Chandran is currently offline Gregory Chandran
Messages: 4
Registered: April 2012
Junior Member
Hi Jarrod,

I managed to setup koneki and eclipse and am wondering if we can debug remotely using corona debugger? did you manage to set this up? If not, how would I go about developing in corona, using the same setup?
Re: Debugging for Corona SDK [message #853714 is a reply to message #840144] Mon, 23 April 2012 09:10 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 guys,
I just posted a quick tutorial to help you setup the LDT debugger for CoronaSDK apps.


Hope you'll find it useful!
Re: Debugging for Corona SDK [message #867656 is a reply to message #853714] Tue, 01 May 2012 12:06 Go to previous messageGo to next message
Girish Joshi is currently offline Girish Joshi
Messages: 2
Registered: May 2012
Junior Member
Hi Benjamin ,

Thanks for this very helpful info. I tried it on win32. It works very well. Only problems is that on connecting to debugger and opening debug perspective, it opens a blank tab for main.lua. The editor window shows 'debug source lookup '. The tab title shows correct path to project main.lua but all in small case. I think path has to be case sensitive. Please let me know how to fix this.

[Updated on: Tue, 01 May 2012 12:06]

Report message to a moderator

Re: Debugging for Corona SDK [message #868001 is a reply to message #867656] Tue, 01 May 2012 15:40 Go to previous messageGo to next message
sean bean is currently offline sean bean
Messages: 4
Registered: May 2012
Junior Member
Hi everyone.
I just have a quick question, I can get the debugger up and running thanks to Benjamins tutorial. However, if I then make changes to my code and save my .lua files, the debugger disconnects, and I have to close corona simulator and debugger, then relaunch from the beginning in eclipse. I was just wondering if there was a quicker way.
Re: Debugging for Corona SDK [message #868595 is a reply to message #868001] Wed, 02 May 2012 09:15 Go to previous messageGo to next message
Benjamin Cabé is currently offline Benjamin Cabé
Messages: 151
Registered: July 2009
Location: Toulouse, France
Senior Member

sean bean wrote on Tue, 01 May 2012 17:40
Hi everyone.
I just have a quick question, I can get the debugger up and running thanks to Benjamins tutorial. However, if I then make changes to my code and save my .lua files, the debugger disconnects, and I have to close corona simulator and debugger, then relaunch from the beginning in eclipse. I was just wondering if there was a quicker way.


Hello Sean,
Unfortunately there is a "facility" in the Corona simulator and debugger that makes it automatically restart whenever a file is modified so as you can immediately see the result of the modification. Maybe you should ask to the Ansca ppl whether it is possible to disable this behavior by using a command line parameter?
In the meantime we could have a special parameter in the LDT debug config to never end a debugging session even though the application under debug has been restarted.
Re: Debugging for Corona SDK [message #868646 is a reply to message #868595] Wed, 02 May 2012 10:40 Go to previous messageGo to next message
sean bean is currently offline sean bean
Messages: 4
Registered: May 2012
Junior Member
Thanks for your response, I just want to clarify what I need to ask the corona guys, so in the event that the corona guys do change anything its useful for the koneki guys to work with.

During a corona debug session; when code is modified, the simulator restarts, but the corona debugger doesn't, instead I get:
Program finished
logout
[Process completed]


So I'm guessing that when code is modified, we want the simulator and debugger to restart and pause on the first line. If this happens is it then possible for the eclipse remote lua debug process to allow the corona debugger to disconnect and then change state to listen to remote debug connection attempts again, so that when the corona debugger restart it automatically connects to the eclipse remote lua debug process ?

I was also wondering if it was possible to do it without any changes to corona, but instead call to launch corona debugger/simulator from within eclipse lua remote debug and be able to quit the processes within eclipse too. Then synchronising this automatically with a lua remote debug process ?
Re: Debugging for Corona SDK [message #877098 is a reply to message #867656] Fri, 25 May 2012 21:37 Go to previous message
Amu Shan is currently offline Amu Shan
Messages: 2
Registered: May 2012
Junior Member
Hi Girish

You mentioned "on connecting to debugger and opening debug perspective, it opens a blank tab for main.lua".

You may have figured out that the Koneki plugin has a bug when running on Windows - it can't recognise a filename which has a space in it.

I believe Benjamin will fix this bug because he has acknowledged in message #872655 in forum topic "Spaces in path causing debug problems?"

[Updated on: Fri, 25 May 2012 21:49]

Report message to a moderator

Previous Topic:ldt under ubuntu 12.04 64bit not running
Next Topic:Debugger timeout on 3.7.2, Windows 7 x64
Goto Forum:
  


Current Time: Wed Oct 22 22:27:48 GMT 2014

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

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