Debugging with LOVE

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
MyOwnClone
Prole
Posts: 2
Joined: Wed Oct 14, 2009 5:38 pm
Location: czech republic
Contact:

Debugging with LOVE

Post 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
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Debugging with LOVE

Post 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.
Help us help you: attach a .love.
dtaylorl
Prole
Posts: 8
Joined: Tue May 19, 2009 2:57 am

Re: Debugging with LOVE

Post 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)
User avatar
Igmon
Prole
Posts: 9
Joined: Wed Mar 11, 2009 6:11 pm

Re: Debugging with LOVE

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Debugging with LOVE

Post by bartbes »

For LovelyBigPlanet I have a console integrated and I use that for debugging too.
User avatar
MyOwnClone
Prole
Posts: 2
Joined: Wed Oct 14, 2009 5:38 pm
Location: czech republic
Contact:

Re: Debugging with LOVE

Post 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...
Codiak
Prole
Posts: 12
Joined: Mon Aug 30, 2010 4:05 pm

Re: Debugging with LOVE

Post 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.
Codiak
Prole
Posts: 12
Joined: Mon Aug 30, 2010 4:05 pm

Re: Debugging with LOVE

Post 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 :(
Codiak
Prole
Posts: 12
Joined: Mon Aug 30, 2010 4:05 pm

Re: Debugging with LOVE

Post 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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests