| CPC G06F 11/006 (2013.01) [G06F 11/0766 (2013.01); G06F 11/0787 (2013.01); G06F 2201/87 (2013.01)] | 20 Claims |

|
1. A method for obtaining information of a stack frame in a call stack, comprising:
obtaining a to-be-processed call stack with an abnormality during running of a program, each area element of the to-be-processed call stack comprising a method pointer and an instruction offset value corresponding to the method pointer, where a total number of area elements of the to-be-processed call stack is N;
applying for a first memory area, a first half of area elements of the first memory area being used to store the method pointer, and a second half of the area elements of the first memory area being used to store the instruction offset value corresponding to the method pointer, wherein a total number of the area elements of the first memory area is 2N;
obtaining an address of the first memory area;
applying for a second memory area, and storing the address of the first memory area into a first area element in the second memory area, wherein a total number of area elements of the second memory area is N+1;
obtaining an address of the second memory area;
applying for a third memory area, obtaining a target storage area in the third memory area, and storing the address of the second memory area into the target storage area; and
obtaining information of each stack frame in the to-be-processed call stack by executing a code segment corresponding to a stack frame information obtaining functional module getStackTrace based on the address of the second memory area stored in the target storage area.
|