Debugging Tools and Tips

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.
User avatar
ejmr
Party member
Posts: 302
Joined: Fri Jun 01, 2012 7:45 am
Location: South Carolina, U.S.A.
Contact:

Debugging Tools and Tips

Post by ejmr »

Hello everyone!

I would like to know what debugging tools you find useful when creating LÖVE games. These can be either specific to LÖVE or more general-purpose tools designed for Lua. I am doing the majority of my work on a Linux box, so I would prefer tools that work well in that environment; however, other people I am working with are using Windows and OSX. So recommendations for debugging tools for any system would be much appreciated. Or if you know of no utilities to suggest, then I would love to hear what your preferred approach is to debugging a LÖVE project.

Thanks in advanced.
ejmr :: Programming and Game-Dev Blog, GitHub
南無妙法蓮華經
Wojak
Party member
Posts: 134
Joined: Tue Jan 24, 2012 7:15 pm

Re: Debugging Tools and Tips

Post by Wojak »

I'm not using any special debugging tools, the “blue error screen” gives enough information to find and correct all syntax errors and some typos and misplaced variables...

there is also a very useful “love.graphics.print()" that may be used do dump variables into the screen (just don't forget co convert everything to string - “tostring()” before displaying it)
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Debugging Tools and Tips

Post by Roland_Yonaba »

Actually, I'm not using any debugging tool. I second Wojak, the blue screen is enough, to me.
But I can conceive that sometimes, one concern might be about optimizing and performance issues.
So here you are:
Hope that might help. :awesome:
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: Debugging Tools and Tips

Post by josefnpat »

I am not a fan of cornflower blue. It distracts me from the terminal, and disorients me.

Here is a quick module for larger projects I wrote called fcblib.lua:

Code: Select all

--[[
 _______________________
< Fuck Cornflower Blue! >
 -----------------------
\                             .       .
 \                           / `.   .' " 
  \                  .---.  <    > <    >  .---.
   \                 |    \  \ - ~ ~ - /  /    |
         _____          ..-~             ~-..-~
        |     |   \~~~\.'                    `./~~~/
       ---------   \__/                        \__/
      .'  O    \     /               /       \  " 
     (_____,    `._.'               |         }  \/~~~/
      `----.          /       }     |        /    \__/
            `-.      |       /      |       /      `. ,~~|
                ~-.__|      /_ - ~ ^|      /- _      `..-'   
                     |     /        |     /     ~-.     `-. _  _  _
                     |_____|        |_____|         ~ - . _ _ _ _ _>

--]]
function love.errhand(msg)
  print(debug.traceback())
  print(msg)
end
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Debugging Tools and Tips

Post by kikito »

I usually debug via print.

In a couple occasions where I needed to debug complex table layouts, I've used my own lib, inspect.lua, to do just that. I can't link to it, typing from mobile phone
When I write def I mean function.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Debugging Tools and Tips

Post by Nixola »

Here it is
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
User avatar
Kadoba
Party member
Posts: 399
Joined: Mon Jan 10, 2011 8:25 am
Location: Oklahoma

Re: Debugging Tools and Tips

Post by Kadoba »

josefnpat wrote:I am not a fan of cornflower blue.
I think somebody snuck a little into your avatar when you weren't looking. :P

I had no idea love.errhand was a thing. I usually just alter love.run and pcall all of the callbacks.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Debugging Tools and Tips

Post by vrld »

The lua-users wiki has a section about debugging Lua code. I've used RLdb, but the interface is very clunky, especially when compared with something like GDB. Believe it or not, using print() in clever places is probably the best option at the moment :(
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
kclanc
Citizen
Posts: 89
Joined: Sun Jan 29, 2012 6:39 pm

Re: Debugging Tools and Tips

Post by kclanc »

vrld wrote:... using print() in clever places is probably the best option at the moment :(
I think that using a debugger and placing asserts and breakpoints is preferable to peppering code with prints. The recent thread on IDEs mentions a couple of IDEs, like the "Lua Development Tools" eclipse plugin, that that can be used.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Debugging Tools and Tips

Post by vrld »

kclanc wrote:I think that using a debugger and placing asserts and breakpoints is preferable to peppering code with prints.
Of course it is. RLdb does a relatively decent job, but the interface is just ... subpar.
kclanc wrote:the "Lua Development Tools" eclipse plugin [...] can be used.
But that forces you to use Eclipse. Now you have two problems.
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
Post Reply

Who is online

Users browsing this forum: No registered users and 77 guests