Chapter Contents

Previous

Next
Debugging C++ Programs

Debugging Initialization and Termination Functions

A typical C++ program contains initialization functions in each compilation at program startup. These functions are called at program startup to initialize static and extern data defined in that compilation. If you want to debug one of these initialization functions, you can set a breakpoint on _ _init (i.e., break _ _init entry). You will then be presented with a numbered list of initialization functions, one for each compilation using the sname for that compilation. See the discussion of the sname option in Chapter 3, "Translator Options," of theSAS/C C++ Development System User's Guide for more information. Select the initialization function that you want to debug. See the section Overloaded Function Names for information on how to select an overloaded function from the list.

Similarly, you can use _ _term for a numbered list of termination functions. By default, the first function name shown in the Status window is one of these initialization functions. While the debugger is stopped in one of these functions, you can debug the initialization of static and extern variables. As you step through the initialization functions, each function is, in turn, shown in the Status window. Note that the initialization and termination functions are not shown in the Source window, as they do not exist in user C++ code.


Bypassing Initialization Functions

If you do not want to debug your program's initialization functions, you can bypass them in one of the following ways:


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.