Browse Prior Art Database

Auto-selection of inlined function frame into debugger stack crawl

IP.com Disclosure Number: IPCOM000230829D
Publication Date: 2013-Sep-13
Document File: 4 page(s) / 721K

Publishing Venue

The IP.com Prior Art Database

Abstract

When compiling a code, compiler, instead of generating a call to a subroutine, may choose to place the subroutine body directly at its call site, subject to further optimizations. Debugger will have to implement a special algorithm to handle this case, in order to preserve the familiar debug operations available for non-inlined functions. This disclosure presents a way to compute the stack crawl for inlined function frames.

This text was extracted from a Microsoft Word document.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 53% of the total text.

Auto-selection of inlined function frame into debugger stack crawl

Abstract

When compiling a code, compiler, instead of generating a call to a subroutine, may choose to place the subroutine body directly at its call site, subject to further optimizations. Debugger will have to implement a special algorithm to handle this case, in order to preserve the familiar debug operations available for non-inlined functions. This disclosure presents a way to compute the stack crawl for inlined function frames.

Body

The presented algorithm presents a way to compute the stack crawl for inlined function frames using DWARF information.

The novel parts of this algorithm are:

-       auto-detection of  top stack frame selection when a breakpoint is set by user at entry address of inlined function (usually the first line of function) :

o    the corresponding inlined function is by default shown on stack crawl if user sets a source breakpoint ;

o    the inner most nested (inlined or non-inlined) function is by default shown if user sets an address breakpoint;

-       inlined functions are identified using the address. The other approaches are using the offset inside the first non-inlined caller for this purpose.

The novel parts in the diagrams that will be presented are colored in green.

The algorithm presented has two main components. First one computes all the inlined function frames for a certain address. The second one selects automatically which of the inlined frames will actually be displayed in the stack crawl.

Fig. 1 Stack unwinding algorithm for inlined function frames.

First part of the algorithm shows how the stack frames are computed by iterating through inlined functions until the first non-inlined function is found. The result of the unwinding process is stored into rawInfo vector.

Fig. 2 Compute the raw info for inline and first non-inline frames

Figure 2 describes this algorithm. It starts by searching the inner most function based on the current address. If no function is found, it means that there isn’t enough debug information available to compute the rawInfo vector and the algorithm stops. If a function is found, compute its properties (such as low address, high address, ...