Sun Visual WorkShop C++ Overview

Debugging

For your debugging tasks, use one of the two closely related debugging tools contained in Sun Visual WorkShop: dbx or the debugger.

For Command-Line Debugging, Use dbx

The dbx debugger is an interactive, source-level, command-line tool. You can use it to run a program in a controlled manner and to inspect the state of a stopped program. dbx gives you complete control of the dynamic execution of a program, including the collection of performance data.

Make use of the multithreaded features that are built into the standard dbx. You can identify all known threads, including their current state, base functions, and current functions. You can also examine thread stack traces. To ensure proper execution, you can debug threads by stepping through or over a thread, navigating between threads, and then resuming execution at any time.


Note -

If you wish to debug your multithreaded application with dbx, you must include the -lthread option at link time.


If You Prefer a GUI, Use the Debugger

Should you favor a graphical interface to dbx, try the debugger (the Sun WorkShop Debugging window). During program execution, dbx obtains detailed information about program behavior and delivers this information to the debugger by a communications protocol. You can debug more easily because you can enter most commands by clicking redefinable buttons in the GUI.

You can also edit your programs with your favorite editor from the debugger and minimize the need to change tools.

Fix and Continue

With the Fix and Continue feature of the debugger you can modify source code, recompile the file, and continue program execution, without leaving the debugger. When you use this feature, you eliminate relinking and reloading the program.

Runtime Checking

Use Runtime Checking (RTC) to find elusive memory access violations and memory leaks in both single-threaded and multithreaded applications. With runtime checking, you can detect runtime errors in an application during the development phase. As errors are detected the debugger interrupts program execution and displays the relevant source code so you can fix bugs as they are found.