C library procedure to allow for source level debugging of C code running in a production capacity.
Original Publication Date: 2001-May-01
Included in the Prior Art Database: 2003-Jun-20
Disclosed is a C language source statement that would aid in debugging a C language program in a performance sensitive production environment by creating an in storage stack of footprints to be dumped in a memory dump. The C language source statement would cause one or more unique eyecatchers to be placed on a stack in storage as each trace requested was executed. The created stack could then be found in the storage of a diagnostic dump to verify the execution path of the module up to the time of failure. This would be accomplished by examining the entries on the stack and the order in which they were placed there. This C language source statement would have several advantages over the current diagnostic capabilities. First, it would allow programs to always gather diagnostic data without significant performance impact. Because memory is used instead of writeln to terminals or files the code is fast. The second advantage is that the trace, once imbedded in the shipped code, is always on. There is no need to enable it and recreate the problem. If a dump is captured on the first failure then much of the diagnostic data has been captured rather than requiring a recreate to activate other diagnostics. Finally, many of the available diagnostic techniques require that the code or execution environment be changed in order for the diagnostic to work. This is not the case with the C trace instruction. This means that the problem may be recreated if necessary, under the exact same conditions in which it occurred initially. The actual function would set aside a stack area in the dynamic area of each LMOD executed to be used for the stack. The C programmer would then use the C trace instruction to pass data to be placed on the stack which would add it the stack in a FIFO. This would all be accomplished by generated assembly language code that would be optimized for performance. 1