Method and device for stack backtracking
The invention discloses a method and device for stack backtracking. The method comprises a step of obtaining a memory value at a current FP-4 position, a step of determining a stack frame structure type used by a current function according to the memory value, and a step of obtaining a return addres...
Gespeichert in:
Hauptverfasser: | , |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention discloses a method and device for stack backtracking. The method comprises a step of obtaining a memory value at a current FP-4 position, a step of determining a stack frame structure type used by a current function according to the memory value, and a step of obtaining a return address and a parent function frame pointer FP according to the stack frame structure type, wherein the current FP-4 is a memory address of moving the value of a current function FP toward a lower address direction by 4 bytes. According to the method and the device, an ARM system program stack frame structure can be automatically identified and processing is carried out according to different structures, so that a stack frame backtracking method can correctly backtrack the stacks of different stack frame structure programs, and the correctness and practicability of the stack frame backtracking method are greatly enhanced.
本文公布了种堆栈回溯的方法及装置,包括:获取当前FP-4位置处的内存值;根据所述内存值确定当前函数使用的栈帧结构类型;根据所述栈帧结构类型,获取返回地址和父函数帧指针FP;其中,所述当前FP-4为当前 |
---|