| 243 | } |
| 244 | |
| 245 | void StackContext::onThreadAttach() |
| 246 | { |
| 247 | #ifdef HXCPP_STACK_IDS |
| 248 | mThreadId = hx::thread::Thread_obj::id(); |
| 249 | |
| 250 | { |
| 251 | std::lock_guard<std::mutex> guard(sStackMapMutex); |
| 252 | sStackMap[mThreadId] = this; |
| 253 | } |
| 254 | #endif |
| 255 | |
| 256 | #ifdef HXCPP_DEBUGGER |
| 257 | if (!mDebugger) |
| 258 | mDebugger = dbgCtxCreate(this); |
| 259 | if (mDebugger) |
| 260 | dbgCtxAttach(mDebugger,this); |
| 261 | #endif |
| 262 | |
| 263 | #ifdef HXCPP_TELEMETRY |
| 264 | if (mTelemetry) |
| 265 | tlmAttach(mTelemetry,this); |
| 266 | #endif |
| 267 | |
| 268 | #ifdef HXCPP_PROFILER |
| 269 | if (mProfiler) |
| 270 | profAttach(mProfiler,this); |
| 271 | #endif |
| 272 | |
| 273 | #ifdef HXCPP_CATCH_SEGV |
| 274 | #ifdef _MSC_VER |
| 275 | mOldSignalFunc = _set_se_translator( hxSignalFunction ); |
| 276 | #else |
| 277 | mOldSignalFunc = signal( SIGSEGV, hxSignalFunction ); |
| 278 | #endif |
| 279 | #endif |
| 280 | } |
| 281 | |
| 282 | void StackContext::onThreadDetach() |
| 283 | { |
no test coverage detected