(context: CpuContext)
| 779 | } |
| 780 | |
| 781 | private backtraceByFramePointer(context: CpuContext): NativePointer[] { |
| 782 | const frames: NativePointer[] = [context.pc]; |
| 783 | let fp = this.getFramePointer(context); |
| 784 | const sp = this.getStackPointer(context); |
| 785 | if (fp === null || sp === null || fp.compare(sp) < 0) { |
| 786 | return frames; |
| 787 | } |
| 788 | |
| 789 | for (let depth = 0; depth < 32; depth++) { |
| 790 | try { |
| 791 | const lr = fp.add(Process.pointerSize).readPointer(); |
| 792 | if (!lr.isNull()) { |
| 793 | frames.push(lr); |
| 794 | } |
| 795 | |
| 796 | const nextFp = fp.readPointer(); |
| 797 | if (nextFp.isNull() || nextFp.compare(fp) <= 0) { |
| 798 | break; |
| 799 | } |
| 800 | fp = nextFp; |
| 801 | } catch (_error) { |
| 802 | break; |
| 803 | } |
| 804 | } |
| 805 | |
| 806 | return frames; |
| 807 | } |
| 808 | |
| 809 | private mergeBacktraceFrames(primary: NativePointer[], fallback: NativePointer[]): NativePointer[] { |
| 810 | const seen = new Set<string>(); |
no test coverage detected