Debugging with remdebug
Posted: Wed Jul 14, 2010 7:19 am
I am trying to debug my module and I notice that remdebug is in the thirdparty directory. Can you give an example of how to use it in T-Engine? I will outline what I am trying with the example module.
I want to debug the player creation, or birth process. I figure putting a breakpoint at line 43 in modules/example/class/Player.lua, right at the start of the Player:init function should do the trick. First, I need to attach the remdebug process to T-Engine, and decided to add the following code to engine/Birther.lua after the initial requires and before the module call:
I can now start T-Engine.app and once I start a new Example Module game and this yields the following entrance in the remdebug process: "Paused at file engine/Birther.lua"
Second, I believe that I need to set up remdebug, specifically basedir. I am running Mac OSX, so everything is contained within the app directory and I think that is where I need to set the base directory. This could be where I am going wrong, but I am executing the following in the remdebug process:
Finally, I want to set a breakpoint in the modules/example/class/Player:init function. So I set about this:
The problem is that the debugger never picks back up. I know that it reaches line 43 since I put a print statement on that line and I see the output from it in stdout. Any suggestions on how to correctly set up remdebug? Thanks!
I want to debug the player creation, or birth process. I figure putting a breakpoint at line 43 in modules/example/class/Player.lua, right at the start of the Player:init function should do the trick. First, I need to attach the remdebug process to T-Engine, and decided to add the following code to engine/Birther.lua after the initial requires and before the module call:
Code: Select all
require "remdebug.engine"
remdebug.engine.start()
Second, I believe that I need to set up remdebug, specifically basedir. I am running Mac OSX, so everything is contained within the app directory and I think that is where I need to set the base directory. This could be where I am going wrong, but I am executing the following in the remdebug process:
Code: Select all
> basedir Applications/Games/T-Engine.app/Contents/Resources/game/
Code: Select all
> setb modules/example/class/Player.lua 43
> listb
Applications/Games/T-Engine.app/Contents/Resources/modules/example/class/Player.lua: 43
> run