How a Compiler Uses the APIs to Generate Debug Data for ILE Programs

To enable source-level debugging of ILE programs, view information must be stored with the compiled program. The ILE compilers use the Create View APIs to create view information. This information is then available to source-level debugger applications through the Source Debugger APIs.

The first API that is called is the Start View Creation (QteStartViewCreation) API, which is used to initialize the debug view creation environment.

The views being created are described by the Add View Description (QteAddViewDescription) API. Examples of views created by a compiler are text views (for example, the input source) and listing views (for example, a compiler output listing). A parameter passed back by this API is the view number, which is used by subsequent APIs to identify the view being processed.

The text of a view comes from files (for example, the input source file to the compiler) or supplied text (for example, macro expansion text). The supplied text is stored with the view information in the program object. The file text is copied at source debugging time when the text is retrieved. Thus, the view information stored for the file text contains references to the files containing the text and not the text itself. The files to be used in a view are described by use of the Add View File (QteAddViewFile) API.

The Add View Text (QteAddViewText) API is used to describe how the text for a view is constructed. The view text can be composed of pieces of text, which are concatenated together when the text is retrieved, according to the instructions specified through this API.

The Add View Map (QteAddViewMap) API is used to map positions in one view to positions in another view. This is necessary to be able to relate positions in one view to equivalent positions in another view. In some cases a map can be generated automatically without using this API (see QteAddViewDescription API). Other maps may need to be supplied to allow certain source debugger functions such as breakpoint processing, in which the breakpoint parameters are supplied by the system in terms of the statement view only.

When the view creation processing is complete, a call to the End View Creation (QteEndViewCreation) API is required.

To use a Create View API, the application must bind to the service program QTECRTVS in QSYS. All Create View API functions are then available to the application.


[ Back to top | Debugger APIs | APIs by category ]