Using SoftBench Debugger

Debugging Dynamic Libraries

Debugging Dynamic Libraries

Dynamically-loaded libraries present special challenges to a debugger, due to the way the operating system implements them. SoftBench Debugger handles most of these issues for you. You can specify which libraries you want to debug.

Programs can contain several kinds of library images:

Static: the library code is physically linked in with your program.

Shared: the linker knows about the library, but it is not linked in with your program. All programs that use the library share a common copy of the library.

Dynamically loaded: the library is not known to the linker, and is loaded when your program requests it by calling a system routine.

When you choose "Execution: Enable Images/Libraries…", the

"Images/Libraries" dialog box presents you with a list of all currently known shared or dynamically loaded libraries used by the program being debugged. (See Figure 7-10.)Because maintaining debug information for each library increases the overhead on your debugging session, SoftBench Debugger allows you to enable only the libraries of interest.

To enable libraries for debugging:

1.Choose "Execution: Enable Images/Libraries…" to display the known libraries.

2.Select one or more libraries from the "Images/Libraries" dialog box and select Enable. You may also double-click on a single item to enable it.

Selecting the Enable All button enables all libraries. Once you enable a library for debugging, it cannot be disabled without exiting SoftBench Debugger.

Chapter 7

209