| 715 | } |
| 716 | |
| 717 | void 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 | |
| 744 | void CDebugger::ListStatistics(asIScriptContext *ctx) |
| 745 | { |
nothing calls this directly
no test coverage detected