Solaris Studio Topics: Debugging

Debugging Applications with Solaris Studio dbx, dbxtool, and the Thread Analyzer

( Click for full-size image)
Successful program debugging is more an art than a science. dbx is an interactive, source-level, post-mortem and real-time command-line debugging 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 collecting performance and memory usage data, monitoring memory access, and detecting memory leaks.

You can use dbx to debug an application written in C, C++, or Fortran. You can also, with some limitations, debug an application that is a mixture of Java code and C JNI (Java Native Interface) code or C++ JNI code.

Check out some of the great advanced debugging features in dbx that set it apart from the rest:
  • Diversity in debugging: Debug applications on SPARC and x86 systems, on Solaris, or Linux operating systems, written using Solaris Studio or gcc compilers.
  • Memory debugger: Collect memory usage data, monitor memory access, check array bounds, and detect memory leaks.
  • Fix and continue: Find a bug while debugging, fix the source, and continue debugging without rebuilding the application.
  • Multithreaded debugging: Debug multithreaded applications written using Solaris/OpenSolaris threads, POSIX threads, and OpenMP.
  • Event handling: Create event-triggered actions, set conditional breakpoints and watchpoints, create trace and exception breakpoints, and send signals.
  • Full command-line access: Enjoy uncompromised access to the dbx command-line console from within the NetBeans-based IDE with full parity between the IDE and dbx command-line programmable console.

Use the stand-alone GUI-based dbx debugger dbxtool.
Use the Thread Analyzer to look for data-races and deadlocks in threaded applications.


Runtime Checking (RTC)
Runtime Checking (RTC) helps you understand how memory is being used in your application and identifies memory leaks and access errors. View the RTC screencast to learn more.
Dbx Debugger
A new standalone GUI debugging solution, dbxtool, is now available with Sun Studio software. The dbx debugger is also available as a command-line utility and is fully integrated into the Sun Studio NetBeans-based IDE. View the screencast to learn about dbxtool and the features of the dbx debugger.  

Dbx Documentation

dbx(1)  man page

Reference Manual: Debugging a Program With dbx

Complete reference for using the debugging tools and how to interpret the results. (December 2011)

See the What's New In Oracle Solaris Studio 12.3 guide for information on new and changed features in the current release of dbx.

Technical Articles

Oracle Solaris Studio FORTRAN Runtime Checking Options
The Oracle Solaris Studio Fortran compiler provides several command line options to enable runtime checks that can make it easier to find and fix bugs in your Fortran programs. This article describes the various options and how to use them. (October 2010)

Optimized Code Debugging With Sun Studio dbx
Use dbx to display the value of local variables and function parameters when applications are compiled with high-level compiler optimization options such as -O2, -O3, -O4, and -O5. (November 2008)
Debugging Multithreaded Programs
Suggests ways of avoiding bugs in your code as well as strategies for finding these bugs using the dbx command-line debugger. (May 2008)
Using DTrace to Demystify Watchpoints in the Sun Studio dbx Debugger
Educates users on how to use the watchpoint facility in the Sun Studio dbx debugger for both source-level and instruction-level debugging. (May 2008)
AMD64 Instruction-Level Debugging With dbx
Details how to use the dbx debugger efficiently to display the contents of memory at specified addresses, and how to display machine instructions. (May 2008)
Using DTrace with Sun Studio Tools to Understand, Analyze, Debug, and Enhance Complex Applications
Describes the DTrace utility and its architecture and shows how different tools can be used to fix software deficiencies and performance problems. (May 2008)
Debugging a JVM Level Hang Using dbx
The Sun Studio tool dbx is used to debug a particularly thorny JVM hang on a Solaris x86 system. (March 2008)
Locating Memory Access Errors With Sun Memory Error Discovery Tool
Learn how the Sun Memory Error Discovery Tool detects and reports common memory access errors such as accessing uninitialized memory, writing past the end of an array, or accessing memory after it has been freed. (September 2007)
Why Can't dbx Find My Function?
What to do when dbx doesn't have all the information it needs. (April 12, 2006)
dbx and System Libraries: Why Can't dbx Read My Process or Core File?
For users of older versions of the Solaris OS and dbx, this article explains the long-standing dependencies that dbx has on various system libraries, how those dependencies can cause problems, and how to fix those problems. (revised March 28, 2006)
Forum: Solaris Studio Tools
Ask questions about and discuss Solaris Studio debuggers and debugging in general with the community of users and experts.