# US 2009/0271801 A1 · Split stage call sequence restoration method

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2009/0271801 A1
- Document ID: US20090271801A1
- Status: Published application
- Kind: A1
- Application number: 11/628,012
- Filed: 2006-08-30
- Published: 2009-10-29
- Earliest claimed: 2006-08-30
- Inventors: Stanislav V. Bratanov; Alexei Alexandrov
- Web page: https://patentgrep.com/patent/US20090271801A1

## CPC

- G06F 11/3471: {Address tracing}
- G06F 9/4486: {Formation of subprogram jump address}
- G06F 9/44521: {Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading}
- G06F 2212/451: Stack data
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Embodiments of the present invention provide for collecting a minimal subset of task execution context in real time and for restoring the task execution context and performing procedure frame unwinding operations at a post-processing stage. A first data structure may be constructed in real time to contain procedure linkage information along with references to the memory area or to a processor register context where each procedure linkage information element (procedure return address or a procedure frame pointer) was originally found. Procedure return addresses may be determined by decoding the instruction preceding the address in question and checking if it is a procedure call instruction. Procedure return addresses may also be determined using other methods (e.g., by checking whether the memory region the address in question belongs to is executable) if the probability of retrieving the correct result is acceptable for a particular area of application of an embodiment of the present invention. Procedure frame pointers may be determined as the conventional memory area elements whose value points back to the conventional memory area. Procedure frame pointers, depending on particular processor architecture, may also have other properties that differentiate them from other elements of the conventional memory area. The conventional memory area for purposes of the present invention may be non-contiguous. The contents of first data structure may then be employed in reconstruction of the task execution environment at the post-processing stage. Then, the procedure frame unwinding operations may be performed over the restored task execution context.

## Claims

### Claim 1

In a system restoring program control flow information, a method comprising:
forming a first data structure from a task execution context at a real-time data collection stage;
restoring a limited execution context from the contents of the first data structure at a post-processing stage; and
performing procedure frame unwinding operations over the restored limited execution context.

### Claim 2 (depends on 1)

The method of claim 1, wherein task execution context comprises at least a processor register state that affects procedure execution and a memory area dedicated to store procedure linkage information.

### Claim 3 (depends on 1)

The method of claim 1, wherein limited execution context comprises the minimal subset of the task execution context sufficient for procedure frame unwinding.

### Claim 4 (depends on 1)

The method of claim 1, wherein the first data structure comprises procedure linkage information elements associated with references to original locations of the elements within the task execution context.

### Claim 5 (depends on 4)

The method of claim 4, wherein procedure linkage information comprises procedure link addresses and procedure frame pointers.

### Claim 6 (depends on 5)

The method of claim 5, wherein procedure link addresses are determined by at least one of checking whether the addresses belong to an executable memory region and checking whether a processor instruction immediately preceding at least one of the addresses is a procedure invocation instruction.

### Claim 7 (depends on 5)

The method of claim 5, wherein procedure frame pointers comprise data records that provide information on at least the size of a local procedure frame allocated for a procedure.

### Claim 8 (depends on 7)

The method of claim 7, further comprising determining procedure frame pointers by checking whether the pointer values are within the range of the memory addresses starting from the current address that contains the frame pointer being checked, if the processor architecture provides for direct access to the memory area from procedure code.

### Claim 9

An article comprising: a machine accessible medium having a plurality of machine readable instructions, wherein when the instructions are executed by a processor, the instructions provide for restoring program control flow information by:
forming a first data structure from a task execution context at a real-time data collection stage;
restoring a limited execution context from the contents of the first data structure at a post-processing stage; and
performing procedure frame unwinding operations over the restored limited execution context.

### Claim 10 (depends on 9)

The article of claim 9, wherein task execution context comprises at least a processor register state that affects procedure execution and a memory area dedicated to store procedure linkage information.

### Claim 11 (depends on 9)

The article of claim 9, wherein limited execution context comprises the minimal subset of the task execution context sufficient for procedure frame unwinding.

### Claim 12 (depends on 9)

The article of claim 9, wherein the first data structure comprises procedure linkage information elements associated with references to the original location of the elements within the task execution context.

### Claim 13 (depends on 12)

The article of claim 12, wherein procedure linkage information comprises procedure link addresses and procedure frame pointers.

### Claim 14 (depends on 13)

The article of claim 13, wherein procedure link addresses are determined by at least one of checking whether the addresses belong to an executable memory region and checking whether a processor instruction immediately preceding at least one of the addresses is a procedure invocation instruction.

### Claim 15 (depends on 13)

The article of claim 13, wherein procedure frame pointers comprise data records that provide information on at least the size of a local procedure frame allocated for a procedure.

### Claim 16 (depends on 15)

The article of claim 15, wherein procedure frame pointers are determined by checking whether the pointer values are within the range of the memory addresses starting from the current address that contains the frame pointer being checked, if the processor architecture provides for direct access to the conventional memory area from procedure code.

### Claim 17

A system that restores program control flow information, comprising:
logic to form a first data structure from a task execution context at a real-time data collection stage;
logic to restore a limited execution context from the contents of the first data structure at a post-processing stage; and
logic to perform procedure frame unwinding operations over the restored limited execution context.

### Claim 18 (depends on 17)

The system of claim 17, wherein task execution context comprises at least a processor register state that affects procedure execution and a memory area dedicated to store procedure linkage information.

### Claim 19 (depends on 17)

The system of claim 17, wherein limited execution context comprises the minimal subset of the task execution context sufficient for procedure frame unwinding.

### Claim 20 (depends on 17)

The system of claim 17, wherein the first data structure comprises procedure linkage information elements associated with references to the original location of the elements within the task execution context.

### Claim 21 (depends on 20)

The system of claim 20, wherein procedure linkage information comprises procedure link addresses and procedure frame pointers.

### Claim 22 (depends on 21)

The system of claim 21, wherein procedure link addresses are determined by at least one of checking whether the addresses belong to an executable memory region and checking whether a processor instruction immediately preceding at least one of the addresses is a procedure invocation instruction.

### Claim 23 (depends on 21)

The system of claim 21, wherein procedure frame pointers comprise data records that provide information on at least the size of a local procedure frame allocated for a procedure.

### Claim 24 (depends on 23)

The system of claim 23, wherein procedure frame pointers are determined by checking whether the pointer values are within the range of the memory addresses starting from the current address that contains the frame pointer being checked, if the processor architecture provides for direct access to the memory area from procedure code.
