(thread)
| 162 | |
| 163 | // returns the matched module name to use as default scope, or null if no match |
| 164 | function matchThread(thread) { |
| 165 | const routine = |
| 166 | thread.entrypoint && thread.entrypoint.routine ? thread.entrypoint.routine : null; |
| 167 | const mo = routine ? routineModuleOffset(routine) : null; |
| 168 | const name = thread.name || ""; |
| 169 | |
| 170 | for (const t of TARGETS) { |
| 171 | if (t.name != null) { |
| 172 | if (name.includes(t.name)) return mo ? mo.module : null; |
| 173 | continue; |
| 174 | } |
| 175 | if (!mo) continue; |
| 176 | if (!mo.module.includes(t.module)) continue; |
| 177 | if (t.offset != null && mo.offset !== t.offset) continue; |
| 178 | return mo.module; // matched; module is the default logging scope |
| 179 | } |
| 180 | return null; |
| 181 | } |
| 182 | |
| 183 | // --- Stalker.exclude: keep instrumentation INSIDE target modules only ------- |
| 184 | // Exclude every loaded module whose name is NOT one of the target modules. |
no test coverage detected