()
| 188 | } |
| 189 | |
| 190 | backtrace(): void { |
| 191 | if (!isShown("bt")) { |
| 192 | return; |
| 193 | } |
| 194 | |
| 195 | const session = this.getPausedSession(); |
| 196 | if (session === null || session.context === null) { |
| 197 | return; |
| 198 | } |
| 199 | |
| 200 | try { |
| 201 | log("[bt] ------------------------------------------------------------", "cyan"); |
| 202 | const frames = this.backtraceByFramePointer(session.context); |
| 203 | const fuzzyFrames = Thread.backtrace(session.context, Backtracer.FUZZY); |
| 204 | const merged = this.mergeBacktraceFrames(frames.length > 1 ? frames : [], fuzzyFrames); |
| 205 | merged.forEach((address, index) => { |
| 206 | const resolved = resolveAddress(address); |
| 207 | log(`[bt] #${index} ${address}${resolved.length > 0 ? ` ${resolved}` : ""}`, "gray"); |
| 208 | }); |
| 209 | } catch (error) { |
| 210 | log(`[bt] failed: ${String(error)}`, "red"); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | disassemble(position?: PointerInput, count = 8): void { |
| 215 | const session = this.getPausedSession(); |
no test coverage detected