MCPcopy Create free account
hub / github.com/anjo76/angelscript / ListGlobalVariables

Method ListGlobalVariables

sdk/add_on/debugger/debugger.cpp:717–742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

715}
716
717void CDebugger::ListGlobalVariables(asIScriptContext *ctx)
718{
719 if( ctx == 0 )
720 {
721 Output("No script is running\n");
722 return;
723 }
724
725 // Determine the current module from the function
726 asIScriptFunction *func = ctx->GetFunction();
727 if( !func ) return;
728
729 asIScriptModule *mod = func->GetModule();
730 if( !mod ) return;
731
732 stringstream s;
733 for( asUINT n = 0; n < mod->GetGlobalVarCount(); n++ )
734 {
735 int typeId = 0;
736 mod->GetGlobalVar(n, 0, 0, &typeId);
737 // TODO: Allow user to set how many recursive expansions should be done
738 // Expand members by default to 3 recursive levels only
739 s << mod->GetGlobalVarDeclaration(n) << " = " << ToString(mod->GetAddressOfGlobalVar(n), typeId, 3, ctx->GetEngine()) << endl;
740 }
741 Output(s.str());
742}
743
744void CDebugger::ListStatistics(asIScriptContext *ctx)
745{

Callers

nothing calls this directly

Calls 8

GetGlobalVarCountMethod · 0.80
GetGlobalVarMethod · 0.80
GetAddressOfGlobalVarMethod · 0.80
strMethod · 0.80
GetFunctionMethod · 0.45
GetModuleMethod · 0.45
GetEngineMethod · 0.45

Tested by

no test coverage detected