| 680 | } |
| 681 | |
| 682 | void CDebugger::ListLocalVariables(asIScriptContext *ctx) |
| 683 | { |
| 684 | if( ctx == 0 ) |
| 685 | { |
| 686 | Output("No script is running\n"); |
| 687 | return; |
| 688 | } |
| 689 | |
| 690 | asIScriptFunction *func = ctx->GetFunction(); |
| 691 | if( !func ) return; |
| 692 | |
| 693 | stringstream s; |
| 694 | for( asUINT n = 0; n < func->GetVarCount(); n++ ) |
| 695 | { |
| 696 | if( ctx->IsVarInScope(n) ) |
| 697 | { |
| 698 | // TODO: Allow user to set if members should be expanded or not |
| 699 | // Expand members by default to 3 recursive levels only |
| 700 | s << func->GetVarDecl(n) << " = " << ToString(ctx->GetAddressOfVar(n), ctx->GetVarTypeId(n), 3, ctx->GetEngine()) << endl; |
| 701 | } |
| 702 | } |
| 703 | Output(s.str()); |
| 704 | } |
| 705 | |
| 706 | void CDebugger::ListGlobalVariables(asIScriptContext *ctx) |
| 707 | { |
nothing calls this directly
no test coverage detected