PRODUCT : Borland C++ NUMBER : 1556 VERSION : All OS : All DATE : October 25, 1993 PAGE : 1/2 TITLE : How to trace into a run-time library function The trace function of the IDE and standalone debugger is a useful tool for tracing the program flow into a function call. However, since the C Runtime Library (RTL) functions are not built with debugging information, you cannot trace into those calls. Pressing F7 while the cursor is on the function simply executes it and returns the cursor to the next line in the program. You cannot trace the function as it is executing. This document describes how you can easily get around this limitation and trace into your RTL functions. You need the RTL source code that shipped with Application Frameworks to take advantage of this technique. For our example, suppose we want to trace through the strcpy() function to learn how it works. 1. Find the source code that contains the desired function, make a copy of this file into your working directory, and optionally rename it. strcpy() is contained in STRCPY.CAS, so we'll make a copy of this file into our working directory and rename it to MYSTRCPY.CAS. 2. At the top of the file, add the following lines: #pragma option -zC_TEXT #pragma option -zR_DATA #pragma option -zTDATA 3. Tell the compiler where to find the header files that are needed by the RTL source file. For the command-line compiler, add C:\BC\CRTL\RTLINC to the -I search path. For the IDE, add the above path to the Include path under Options | Directories. 4. If you use the command-line compiler, add the new copy of the RTL source file (MYSTRCPY.CAS in our example) to your list of .C or .CPP files. If you use the Integrated Development Environment (IDE), add it to your project file list, or create one if you don't already use a project. 5. Build your program with the debug info turned on. For BCC and TLINK use -v. For IDE select Option | Compiler | Advanced Code Generation and turn on Debug Info in OBJs. PRODUCT : Borland C++ NUMBER : 1556 VERSION : All OS : All DATE : October 25, 1993 PAGE : 2/2 TITLE : How to trace into a run-time library function That is all. Now when we come to a line with strcpy(), we can hit F7 and trace into the statements for that function. DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.