Standalone-AOT contexts are constructed as member objects (see daslib/aot_standalone.das::writeStandaloneCtor), not via make_shared, so their weak_from_this() is empty and shared_from_this() throws bad_weak_ptr. The agent adapter only needs the context's raw pointer for dispatch (passed at make_debug_agent time); debugAgentContext is only consulted by getDebugAgentContext, which already returns an
| 857 | // error for null. So fall back to a null shared_ptr in that case |
| 858 | // instead of aborting the process. |
| 859 | static inline shared_ptr<Context> debugAgentContextOrNull ( Context * context ) { |
| 860 | auto wp = context->weak_from_this(); |
| 861 | return wp.expired() ? nullptr : wp.lock(); |
| 862 | } |
| 863 | |
| 864 | void installThreadLocalDebugAgent ( DebugAgentPtr newAgent, LineInfoArg * at, Context * context ) { |
| 865 | if ( *daScriptEnvironment::g_threadLocalDebugAgent && (*daScriptEnvironment::g_threadLocalDebugAgent)->debugAgent ) { |
no outgoing calls
no test coverage detected