| 723 | }; |
| 724 | |
| 725 | string Context::getStackWalk ( const LineInfo * at, bool showArguments, bool showLocalVariables, bool showOutOfScope, bool stackTopOnly ) { |
| 726 | FPE_DISABLE; |
| 727 | TextWriter ssw; |
| 728 | #if DAS_ENABLE_STACK_WALK |
| 729 | ssw << "\n"; |
| 730 | if ( at ) { |
| 731 | ssw << "from " << at->describe() << "\n"; |
| 732 | } |
| 733 | char * sp = stack.ap(); |
| 734 | ssw << "CALL STACK (sp=" << (stack.top() - stack.ap()) |
| 735 | << ",sptr=0x" << HEX << intptr_t(sp) << DEC << "):\n"; |
| 736 | StackWalkerTextWriter walker ( ssw, this ); |
| 737 | walker.showArguments = showArguments; |
| 738 | walker.showLocalVariables = showLocalVariables; |
| 739 | walker.showOutOfScope = showOutOfScope; |
| 740 | walker.stackTopOnly = stackTopOnly; |
| 741 | dapiStackWalk ( &walker, *this, at ? *at : LineInfo() ); |
| 742 | ssw << "\n"; |
| 743 | #else |
| 744 | ssw << "\nCALL STACK TRACKING DISABLED:\n\n"; |
| 745 | #endif |
| 746 | return ssw.str(); |
| 747 | } |
| 748 | |
| 749 | void tickSpecificDebugAgent ( const char * name ) { |
| 750 | std::lock_guard<std::recursive_mutex> guard(g_DebugAgentMutex); |