Jump to content

Script callstack from C++


photo

Recommended Posts

Annoyed with not being able to see from where in script my external function was being called, I did a small experiment. Added one function to Machine class with only two lines of code within, this allowed script callstack to be requested on demand from the Visual Studio debugger :D

void Machine::debugDump() const {
	Log::message("Stack dump:\n%s",interpreter->getStackDump().get());
	Log::message("Call stack:\n%s",interpreter->getCallStack().get());
}

post-999-0-98080200-1438085634_thumb.png

 

It's very easy to use, just navigate to Machine::run in the callstack, and in the immediate window enter debugDump() and it will output the callstack of script functions that were leading to the external function being called. Perhaps something that can be included by default?

  • Like 1
Link to comment
×
×
  • Create New...