E&S Desktop Graphics OpenGL Trace Tool
Design Documentation
Create: 8.25.1999
Introduction (Preliminary Design)
|
Purpose The purpose the Desktop Graphics OpenGL Trace project (referred to as DgTrace from here on), is to provide an accurate call-by-call trace of OpenGL procedures that an application makes, documenting the sequence and any data passed in as arguments to these procedures. This can be done either through an output file, or through a control application that can trace in real-time. This is done with the intent of facilitating debugging and observation of OpenGL programs by isolating and documenting the sequence of OpenGL calls. Secondly, given the trace output (in either ASCII or binary format), the programmer should be able to (1) easily follow the trace and (2) run or "playback" an arbitrary segment of the trace, either in an DgTrace container application or be given the equivalent C/C++ code segment. Interception Of OpenGL Calls DgTrace traces the OpenGL call by inserting an additional layer between OpenGL and the calling application. This is done by replacing the OpenGL Dynamic Link Library (opengl32.dll) with the intercepting trace DLL that has the same set of GL entry points, each of which (after documenting the trace) will call the respective procedure in the original OpenGL DLL. Each trace DLL function will output (either to file or control application) information about the function currently being called and explicitly record any arguments passed in, including all array-elements and members of indirect data-structures. The trace will be on a per-process level, so that if there are multiple OpenGL applications running, each one will have its independent trace. Additionally, there will exist a mechanism by which the user can take arbitrary "snap-shots" of the OpenGL states. Tracing OpenGL The trace can be communicated to the user in one or more of the following ways:
2. Binary file (for faster trace, and playback) 3. Windowed real-time observation 4. User generated, real-time "breakpoints" The DgTrace output should include the following information for all procedures being traced.
2. All argument names and values, including pointer values. 3. All elements of arrays (i.e. matrices, vertices list) 4. Members of data structures (i.e. PFD) 5. Any value to be returned. Additionally, there will be information that will trace any OpenGL state changes. Playback of trace data In the case that the user is interested in a particular section of the trace, he/she will be able to run, or "playback" that section of OpenGL calls. One option is to use the trace container application. This program will load the "real" opengl32.dll and interpret the trace in order to (1) replicate the OpenGL states as closely as possible to the OpenGL states at the beginning of the section of interest and (2) sequentially execute the OpenGL procedures documented in the trace section, with the same arguments. Arrays (i.e. matrices, vertices) and indirect data structures (i.e. PFD) will be reconstructed and filled with the corresponding values recorded from the trace. Another option is to reconstruct a particular section of OpenGL trace is to obtain a C/C++ translation of the trace section. Like the container application option, this option will also take into account arrays and pointers to indirect structures. |