Game Development Community

Looking for Debugging Advice

by Harry Durnan · in Torque Game Builder · 01/13/2014 (6:26 pm) · 10 replies

Hello All,

I'm looking for some ideas on how to debug an issue. One user is having my game hang on a particular part, which I have not been able to reproduce. I got a few console logs back from him after I had added a lot of extra outputs to it and it doesn't seem to be doing much in the script when it crashes. I tried to get memory dump of the process, but when I try to open it up in Visual Studios I get a screen saying that I can't debug a 64 bit dump of a 32 bit process :/ Any ideas on how to go about figuring out what is wrong with it on his machine?

Thanks!

#1
01/13/2014 (9:43 pm)
How is the process compiled? As 32-bit? What architecture are you running? 64-bit or 32-bit?

A crash dump will help you tremendously.
#2
01/14/2014 (5:12 am)
The TGB process was compiled as the default Win32 that is in my MS Visual C++ express. I'm actually running Windows 7, which is a 64 bit OS from what I can tell - and I'm not having issues with it myself. Granted, the user having the problem sent me screen shots in Russian so I'm not 100% sure what OS he is using from them.... but, I'm guessing it's also Windows 7 from the layout. I guess I could try to figure out how to compile a 64 bit version :)
#3
01/14/2014 (6:07 am)
You should be able to look at a 32-bit memory dump even if you're running 64-bit yourself.

My experience is that you need a memory dump to fix bugs that you can't reproduce. Or you're going to be stumbling in the dark forever.
#4
01/14/2014 (6:30 am)
And lets not rule out the possibility of a hardware fault or a bad install. Has he uninstalled and reinstalled the software to a new location to ensure that the hard drive isn't faulty? Is that particular point a moment where a new sound or graphic would be loaded? Sounds in particular are great for crashing TGB or failing to load if they're in the wrong format - or the sound card drivers are bad.
#5
01/14/2014 (6:52 pm)
Found this article that should hopefully help - going to try this out: http://blogs.msdn.com/b/amb/archive/2012/05/28/10163879.aspx . Apparently need to run the 32 bit version of task manager, or use another process to get the dump.
#6
01/15/2014 (6:12 pm)
Ok, probably a dumb follow up question: How does one go about loading symbols for your compiled game project? I finally got a dump that I can look at in Visual Studios, but I'm not sure how to get symbols loaded for the executable.
#7
01/23/2014 (6:41 am)
Build the executable for debug.

Microsoft's site should have information on using a dump in this fashion. I've never done it but I know it's common practice in commercial settings.

<edit>
In fact - Game Coding Complete covers debugging using dumps @ about page 805~815.
#8
01/24/2014 (8:33 pm)
Well, my question with TGB is that since it compiles the executable, how do you get it to generate a debug version? Does it do it if you compile a debug version of TGB itself?
#9
01/24/2014 (10:20 pm)
Time out - what?

You compile an executable using Visual Studio. When you create a project, it copies that executable (or the default one included in <torque install dir>/tgb/gameData/T2DProject) - it doesn't compile the executable during the project creation process. If you update the engine source and rebuild you have to then copy the new executables (which will be dropped into the <torque install dir>/tgb/gameData/T2DProject folder in place of the ones that ship with the original install) to your game project for those changes to be used in your game.

tl/dr: you have to compile the engine using a tool outside of the TGB install - namely Visual Studio.

<edited to add information>
Torque Game Builder 1.7.5 Pro:
Open the <TGBPro install folder>/engine/compilers/VisualStudio2008/T2D SDK.sln solution (or 2005 if that is what you are using) and build the TGBGame project to build the game executable - or you can just build the whole solution.

Torque 2D Pro 1.7.6:
Open the <T2DPro install folder>/engine/compilers/<your compiler version>/T2D SDK.sln solution and build the TGBGame project to build the game executable - or you can just build the whole solution.

Torque 2D Pro 1.8:
Open the <T2DPro install folder>/engine/compilers/<your compiler version>/T2D SDK.sln solution and build the TGBGame project to build the game executable - or you can just build the whole solution.

NOTE: The new game executables will be in <torque install dir>/tgb/gameData/T2DProject - NOT your game project folder.
#10
03/17/2014 (9:42 pm)
Thanks, I'll give it a try :)