Debugging Source Code
by PrvtHudson · in Torque Game Engine · 05/13/2006 (10:06 am) · 6 replies
This thread is continued from .. http://www.garagegames.com/mg/forums/result.thread.php?qt=44176#337696
@Dan thanx, You were correct, my PWD was wrong. I am now getting a "There is no source code available for the current location." I don't underatand this because I am supplying the command argument from the working (RELEASE) version. My command argument is "-mission starter.fps/data/missions/entrance.mis" under Project Properties page -> Configuration Properies -> Debugging
/// Main loop of the game
int DemoGame::main(int argc, const char **argv)
// Set up the command line args for the console scripts...
Con::setIntVariable("Game::argc", argc); <-- console.cc
void setIntVariable(const char *varName, S32 value)
S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...) <--winstrings.cc
{
S32 len = vsprintf(buffer, format, args); <----- popup err
The debug display of value of args is : -->3 'boxcharacter'<--
@Dave - Thanx, yes I am using the _DEBUG version of the executeable. I am able to debug, but I get the above error.
@Dan thanx, You were correct, my PWD was wrong. I am now getting a "There is no source code available for the current location." I don't underatand this because I am supplying the command argument from the working (RELEASE) version. My command argument is "-mission starter.fps/data/missions/entrance.mis" under Project Properties page -> Configuration Properies -> Debugging
/// Main loop of the game
int DemoGame::main(int argc, const char **argv)
// Set up the command line args for the console scripts...
Con::setIntVariable("Game::argc", argc); <-- console.cc
void setIntVariable(const char *varName, S32 value)
S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...) <--winstrings.cc
{
S32 len = vsprintf(buffer, format, args); <----- popup err
The debug display of value of args is : -->3 'boxcharacter'<--
@Dave - Thanx, yes I am using the _DEBUG version of the executeable. I am able to debug, but I get the above error.
About the author
#2
When I run TorqueLightingKit from Torsion, it works. When I run TorqueDemo_DEBUG from Torsion, it fails. I am getting a : Fatal: (c:\torque\sdk\engine\terrain\waterblock.cc @ 716) Error, GL not in canonical state on exit.
I was getting these errors on other scripts ... so I took them out, but now I am not able to isolate what script is generating the error.
If I set a breakpoint in VC and try to debug, I get in a loop ( with no display ) long before I ever get to line 716.
It seeme the AssertFatal()s are only implimented in dubug?
05/14/2006 (1:21 pm)
I took your advice and got alot farther in isoltaing the problem. Instead of debugging from VC, I am debugging from Torsion.When I run TorqueLightingKit from Torsion, it works. When I run TorqueDemo_DEBUG from Torsion, it fails. I am getting a : Fatal: (c:\torque\sdk\engine\terrain\waterblock.cc @ 716) Error, GL not in canonical state on exit.
I was getting these errors on other scripts ... so I took them out, but now I am not able to isolate what script is generating the error.
If I set a breakpoint in VC and try to debug, I get in a loop ( with no display ) long before I ever get to line 716.
It seeme the AssertFatal()s are only implimented in dubug?
#3
Randy -
i think you already know this but just in case,
there are two programming languages involved in the Torque Engine:
C++, and Torque Script.
C++ files end in ".cc", and Torque Script files in ".cs".
So when you see an error occuring in waterblock.cc, you know it's in the C++ side.
Also,
AFAIK, Torsion won't help you debug C++. It will debug Script tho.
So you sort of have to flip back and forth.
Regarding your specific problems,
if you haven't made many modifications to the engine,
i recommend taking a step back and starting from a nice clean copy of TLK.
It basically shouldn't be throwing AssertFatals.
05/14/2006 (2:01 pm)
Quote:It seeme the AssertFatal()s are only implimented in dubug?yes.
Randy -
i think you already know this but just in case,
there are two programming languages involved in the Torque Engine:
C++, and Torque Script.
C++ files end in ".cc", and Torque Script files in ".cs".
So when you see an error occuring in waterblock.cc, you know it's in the C++ side.
Also,
AFAIK, Torsion won't help you debug C++. It will debug Script tho.
So you sort of have to flip back and forth.
Regarding your specific problems,
if you haven't made many modifications to the engine,
i recommend taking a step back and starting from a nice clean copy of TLK.
It basically shouldn't be throwing AssertFatals.
#4
If so are you missing a call to restore the canonical state such as:
There are some other threads if you do a search on "canonical" in the forums.
As far as:
05/14/2006 (4:37 pm)
Are you using a custom object type such as fxRenderObject (Generic Render Object)?If so are you missing a call to restore the canonical state such as:
// Restore our canonical viewport state. dglSetViewport(viewport);
There are some other threads if you do a search on "canonical" in the forums.
As far as:
Quote:If you have a break point set you should be able to run at this point and let it go to your break point.
If I set a breakpoint in VC and try to debug, I get in a loop ( with no display ) long before I ever get to line 716.
#5
Now it's time to put things back together with the focus on understanding the engine this time. It's so easy to lose focus when there are so many great resources posted out here ;)
05/14/2006 (10:20 pm)
Thank you gentlemen. I backed up and initialized to 1.4 TLK. My project runs absolutely fine in both RELEASE and DEBUG mode now. @Orion ... no AssertFatals ! @Dan - The debugging is working as expected.Now it's time to put things back together with the focus on understanding the engine this time. It's so easy to lose focus when there are so many great resources posted out here ;)
#6
05/14/2006 (10:24 pm)
Word !
Torque Owner Dan -
I believe it should be:
-mod starter.fps -game entrance
You could also open a command window and try the command to ensure that it load properly without the over head of Express.
Hope that helps.