| 933 | |
| 934 | |
| 935 | def install_debug_wrapper(sym): |
| 936 | if settings.MINIMAL_RUNTIME or not settings.ASSERTIONS: |
| 937 | return False |
| 938 | if settings.EMBIND_GEN_MODE and sym.startswith('asyncify_'): |
| 939 | return False |
| 940 | # The emscripten stack functions are called very early (by writeStackCookie) before |
| 941 | # the runtime is initialized so we can't create these wrappers that check for |
| 942 | # runtimeInitialized. |
| 943 | if sym.startswith(('__asan_', '__lsan_', 'emscripten_stack_', '_emscripten_stack_')): |
| 944 | return False |
| 945 | # `__trap` can occur before the runtime is initialized since it is used in abort. |
| 946 | # `emscripten_get_sbrk_ptr` can be called prior to runtime initialization by |
| 947 | # the dynamic linking code. |
| 948 | # `pthread_self` is used in `checkMailbox` after program shutdown. |
| 949 | return sym not in {'__trap', 'emscripten_get_sbrk_ptr', 'pthread_self'} |
| 950 | |
| 951 | |
| 952 | def should_export(sym): |