Whos calling my function?
by Drethon · in Torque Game Builder · 09/09/2009 (9:16 pm) · 5 replies
I've got a behavior failing because the deselect function is being called. I've searched for deselect throughout my project and it is only being called in one location. A debug output shows that branch is never executed.
Is there any way I can figure out who is calling this function or what might cause it to be called when the only possible calling branch is never executed?
Is there any way I can figure out who is calling this function or what might cause it to be called when the only possible calling branch is never executed?
#2
I expect this requires more digging than Torsion (since you're seeing the C++ side rather than the TorqueScript side) but it should work.
09/09/2009 (11:09 pm)
Alternatively, if you have a source license, you can call the debug() TorqueScript function in your deselect() function, and then run your game in the debugger. debug() calls Platform::debugBreak() in C++, which stops debug execution and turns over control to the debugger. Then you can look at your debugger's call stack (specifically, the calls to CodeBlock::exec(), Con::evaluate(), etc.).I expect this requires more digging than Torsion (since you're seeing the C++ side rather than the TorqueScript side) but it should work.
#3
09/10/2009 (6:40 pm)
I had not noticed those debug features in Torsion before. It showed me there was another place the function was being called which needed a fix. This is weird since a search of all files in the project did not show that function call...
#4
09/11/2009 (12:00 pm)
getScopeName() is also handy for finding who's calling a method. it's a simple modification as well to make getTrace(), which dumps the entire script callstack.
#5
I implemented the getScopeName() resource: very useful, thanks! I suggest all to do the same ^^
While implementing it, I noticed a TGB global variable mismatch and I reported here.
05/15/2010 (3:49 am)
Hi Orion,I implemented the getScopeName() resource: very useful, thanks! I suggest all to do the same ^^
While implementing it, I noticed a TGB global variable mismatch and I reported here.
Torque Owner Giuseppe Bertone
DGform s.r.l.
I can't understand your problem: could you provide a better description for that?
Anyway, you should be able to achieve a fast response using Torsion callstack feature. A 30 days trial should be enough for this problem but I think once you tested Torsion you can't script without it anymore. :-)