Page 1 of 1

Debugging with LOVE

Posted: Wed Oct 14, 2009 5:47 pm
by MyOwnClone
Dear friends,
I'd like to ask some questions about debugging habits you use when developing with Love. Sorry if I am misinformed, but I was not able to find any serious text about how to do this. The only thing I know is that stderr/stdout is redirected to dir where love.exe resides (on windows).
But how can I be able to set breakpoint, trace a program or view value of specific variable? Especially when there is no direct control of lua interpreter (i have access only to love.exe). Do you guys use some high level library for it (no I don't mean debug module in lua)?
I love Love :rofl: , but without basic debugging tools, it is really pain to develop in it. I have project in development made with Love (its my bachelors thesis) and I dont want to switch the API :brows: .
Thanx for any response, friends.

Tomas Vymazal

Re: Debugging with LOVE

Posted: Wed Oct 14, 2009 6:03 pm
by Robin
The only debugging facility for LÖVE I ever use is this place (/me makes wide gesture with both arms): the LÖVE CLUB. ;)

OK, I'm sorry, I don't have a real answer. :shock:

Good luck with your thesis, though.

Re: Debugging with LOVE

Posted: Thu Oct 15, 2009 12:55 am
by dtaylorl
I'm on Ubuntu, so I don't know how it transfers but I always run my love games through a terminal. I use the print method somewhere in my code and it writes the info to the terminal.

Code: Select all

a = "example"
print(a)

Re: Debugging with LOVE

Posted: Thu Oct 15, 2009 4:52 pm
by Igmon
There are several ways to debugging lua you can:

1) Find an IDE that supports remote debugging with lua. I never really explored this option much, but I think the problem with this is (at least the ones I've seen) requires you to integrate their lib to the lua application or it requires debug data files generated when you build the lua application.

2) The one I'm currently using right now: Decoda. This allows you to have breakpoints, stack trace, and watchers. The only catch is that it requires the .pdb file that is generated when you compile the lua application (I think only visual studio creates that file). It was definitely worth it for me and the love project has the solution/project files for you to directly build.

3) Use lua's built in debug api. There's a lot of info on this in Programming In Lua book or the Lua Reference Manual.

Re: Debugging with LOVE

Posted: Sat Oct 17, 2009 5:59 pm
by bartbes
For LovelyBigPlanet I have a console integrated and I use that for debugging too.

Re: Debugging with LOVE

Posted: Sat Oct 17, 2009 9:25 pm
by MyOwnClone
Bartbes: thanx, but yesterday I started writing my own debugging console. Now I have console in/out, print redirection to console, printing values of specified variables or tables. I am planning to implements watches and breakpoints (via sethook - hoping to get it done). Anyway, I will give that debug console to community for free use...

Re: Debugging with LOVE

Posted: Mon Aug 30, 2010 4:30 pm
by Codiak
Igmon wrote:2) The one I'm currently using right now: Decoda. This allows you to have breakpoints, stack trace, and watchers. The only catch is that it requires the .pdb file that is generated when you compile the lua application (I think only visual studio creates that file). It was definitely worth it for me and the love project has the solution/project files for you to directly build.
Hey, could someone explain how to use LOVE with Decoda? I've spent ages researching debugging techniques and I want to use Decoda but when I try to debug some code it comes up with the project settings window where on the tutorial video it says you have input the executable of the project. Now is there a way to create an executable for your game because love.exe just opens that tank demo. I thought about creating a shortcut icon of love.exe and adding my game to the target so I would have an icon to run my game, but I can't see any documentation on how to do that so is it not possible? The tutorial mentions where to add a .pdb file but if this is the only way can someone explain how you generate it. As far as I can tell you can't compile lua in Visual Studio but if it is possible to compile and debug in VS then that would be an option for me.

Thank you.

Re: Debugging with LOVE

Posted: Mon Aug 30, 2010 5:02 pm
by Codiak
Ok worked out you can create a shortcut icon to a game by putting this in target: (root)\LOVE\love.exe (root)\LOVE\(game)

But probably should have realised putting the shortcut in Decoda still just opens love.exe as it is only a shortcut :(

Re: Debugging with LOVE

Posted: Mon Aug 30, 2010 7:57 pm
by Codiak
Ok I've created an executable by following the distribution article on the wiki and set that to the .exe Decoda uses. However this means every time I have a problem I have to repackage the game and set the new .exe in Decoda. But at least it's something.