This article provides an overview of the Intel® Debugger for Linux* as included with the Intel® Composer XE for Linux* and Intel® Parallel Studio XE distributions. A more detailed whitepaper is attached in PDF format. The increased complexity of modern applications along with the advent of multi-core processor technology and concurrent multi-threaded program execution models makes thread specific runtime control and direct accessibility of threading properties inside of a debug solution ever more important. The Intel® Debugger for Linux* is a fully Eclipse* graphical user interface based debug solution with advanced features intended to achieve exactly that. In this whitepaper we will cover the capabilities of the Intel® Debugger for Linux* that address ways to enable faster coding issue identification and resolution.
Please also have a close look at the more expansive whitepaper attached in PDF format.
Hardware Platform: IA-32, Intel®64 architecture or compatible.
Software Platform: Linux* OS based environment
Java runtime environment (JRE 1.5 or JRE 1.6) to use the Eclipse* framework
The Intel® Debugger works with the following compilers:
Intel® C++ Compilers and Intel® Fortran Compilers
gcc, g++, and g77 compilers
See the Intel® Debugger Manual for more information. Please also see the release notes for platform specific restrictions and known limitations of this release.
Intel's compilers generate high quality symbol information even when advanced optimization techniques are being used and thus enable effective debugging on the wide variety of platforms they support. Intel compilers work with native debuggers, the Intel® Debugger, and selected third-party debuggers. Conversely the Intel® Debugger and it's advanced GUI and threading awareness can be used with application code generated by a variety of compilers. The added value provided by the Intel® Debugger includes enhanced visibility and more in depth understanding of
the data shared between multiple threads in Intel® C++ Compiler built applications
thread runtime behavior and thread interaction
the vectorized data streams processed in Single Instruction Multiple Data (SIMD) registers,
active OpenMP tasks lock information and thread team hierarchies.
Excellent Intel® hardware support (especially for early adopters)
Robust performance on Intel processor-based platforms (built and thoroughly tested using Intel compilers)
Superior language-feature support, including C++ templates, user-defined operators, and modern Fortran dialects (with Fortran module support)
Progressive support for the Intel compiler-specific features such as optimized code debugging and OpenMP*
Special features, such as support for huge applications, regular-expression search of the symbol table, breakpoints that track shared libraries as they are dynamically remapped throughout an address space, and support for applications, that are distributed via MPI-1
Support for native compilers as well as Intel® compilers. This support gives customers a high degree of flexibility for mixing and matching development
Tools to meet the unique demands of their specific development environments
The Intel® Debugger for Linux* is a part of the Intel® C++ Composer XE 2011 for Linux* and Intel® Fortran Composer XE 2011 for Linux*. It is a symbolic source-code application debugger that helps programmers find run-time programming errors. These errors include wrong code, memory leaks, stack overflows, unexpected exceptions or other algorithmic problems. The Intel® Debugger can debug both single and multithreaded applications, serial and parallel code. In its latest version we added improved thread awareness and thread-specific breakpoint handling. The application run-time control supports lockstep stepping following a thread syncpoint, defining thread teams and even forced serialized execution of parts of your threaded application. Also we now provide OpenMP windows with information about current tasks, teams, task waits, barriers, task spawn trees and locks. A SSE Windows that gives you access to SSE registers commonly used for data vectorization and single instruction multiple data (SIMD) handling. It displays vectors as rows (or columns) in a table display. You can change layout the data in those registers to match what the application is using or view the data in any other way you like. Finally the debugger supports STL code.
The Intel® Debugger has a wide range of standard and advanced features. The standard features normally expected in a debugger include:
• Attaches to (and detaches from) a running process and debugs the matching program
• Loads a program into (and unloads a program from) the debugger, automatically creating and deleting processes as necessary
• Supports multiple-process debugging, associating with one or more programs:
- Actively run one process at a time
- Switch focus between processes
- See processes and examine detailed process state
- Set breakpoints for a specific process
• Debugs programs with shared libraries
• Debugs core files
• Provides language-specific command-expression evaluation
• Provides ability to "call" functions in a target process from within a command expression
• Catches or ignores unaligned access
• Displays the source listing of a program
• Sets breakpoints to stop program execution when specified sections of program code execute
• Sets watchpoints to stop program execution when the program writes to a memory address
• Adds conditions to breakpoints and watchpoints so program execution will only stop when the condition is true
• Supports setting of pending breakpoints if a breakpoint location cannot be resolved to an address at the time it is being set
• Steps both into or over calls to routines
• Steps through the execution of a program one source line or one machine instruction at a time
• Examines the stack of currently active functions
• Examines and changes program variables and data structure values in same or in different scopes
• Examines and changes the contents of memory in various formats (including international character strings)
• Disassembles and examines machine code
• Examines and changes machine register values
• Supports mixed-language applications, C++ templates, C++ user-defined operators, and Fortran modules
• Provides a customizable debugging environment by using environment variables, initialization files, sourced scripts, aliases (i.e., parameterized macros), and debugger variables for commands and command sequences
• Debug at both the source and assembly level.
• Debug from the command line or from the windowed version of the tool.
Intel Debugger also provides:
• Regular expression searches of the symbol table
• Tracks breakpoints and watchpoints in shared libraries across program calls to dlopen() and dlclose()
• Debugs optimized code:
- In-lined instances of functions (show in backtrace and selectable for current focus)
- Registerized variables
- Semantic stepping
- PC-to-source column mapping (for multi-statement lines)
• Supports multi-core architecture:
- Debugs thread-parallel applications that make use of pthread and OpenMP*
- Provides details on OpenMP* locks, teams, and threads when debugging OpenMP* applications
- Stops all threads when one stops, and restarts all when one restarts
- Switches focus between threads
- Sees all threads or individual threads, and examines detailed thread state
- Sets breakpoints for all threads or for a subset of all threads
- Detects thread data sharing events in parallel applications that make use of pthread, OpenMP*, Intel® CilkTM Plus and Intel® Threading Building Blocks
• Supports cluster architecture:
- Debugs cluster-parallel applications that make use of MPI-1
- Supports debugging of MPI jobs that use mpich or the Intel MPI 3.0 libraries
- Offers built-in cluster aggregation network
- Includes user defined process sets
These advanced features extend the effectiveness of Intel Debugger well into problem areas that are traditionally difficult to debug.
Graphical User Interface
The Intel® Debugger by default is launched using the idb executable in the
directory. Unless you use the idbc executable instead this will launch the full Eclipse* Rich Client Platform based GUI of the debugger.
The graphical user interface supports a rich user experience with intuitive access to all the standard debug features like stepping, breakpoints, callstack, source code switching, disassembly, variable views, and memory windows.
The Intel® Debugger allows for increased thread run-time control during debug sessions with flexible thread execution models. It is possible to pick an individual focus thread for single stepping, halt and release inidvidual threads or pick a threas that should be under run-time control while the other threads are either halted or running freely.
This feature set is made even more useful by the ability to pick a group of threads either by selecting one of the debugger’s default groups or by defining a new thread group that you would like to apply breakpoints, single steps or other debugger control events to.
The thread-specific run-time control features extend to breakpoints as well. The full range of thread-grouping features can be used to select which applicaton threads code and data breakpoints shall be applied to.
To alter the parallel execution flow of all the threads in a given thread group something called syncpoints has been implemented in the Intel® Debugger. A Syncpoint allows to have all threads in a trigger group stop execution at one defined point. From this syncpoint the developer can then do syncronized locked stepping. This behavior of a syncpoint is very similar to how a thread barrier would act in regular parallel code execution flow. The difference is that the debugger allows you to temporarily simulate this execution flow behavior to better understand interactions between different threads and identify possible threading issues
To go one step further and essentially turn off parallel execution for a parallel section of the application code it is also possible to force serialized eyecution of a parallel application implemented with OpenMP*. This can be quite useful to clarify whether a runtime issue is caused by a serial algorithmic problem or has been introduced when OpenMP* directives were added. The code segment of the parallel region associated with the current program counter memory location will be put into serial single-threaded execution mode.
Last but not least the Intel® Debugger adds OpenMP* property windows. This feature displays and allows to monitor currently active OpenMP* threads, teams, barriers, locks, spawn trees and taskwaits in the debugged application, along with the exact curent execution state of all OpenMP* threads.
Overview Listing of Debugger Features specifically addressing Parallelism
Flexible Thread Execution Models
• Concept of “focus” thread set for next/step/finish
• Freezing and thawing of individual threads
• Can detach threads from debug control
• Smart default groupings by debugger (All, Team, Lockstep)
• Explicit grouping by user if required
Thread Group aware breakpoints
• Break when any member of the trigger group hit
• Can stop a specific thread set only
Thread Synchronizing Breakpoint “syncpoint”
• Stop when all threads in the trigger group reach it
• Similar to “barriers” in parallel programming
Dedicated OpenMP* Info Windows
• Threads, Teams, Tasks,Task spawn trees, Barriers, Taskwaits, Locks
• Serial execution of a parallel region at debug time
Thread Data Sharing Events
• Halt execution when two threads access the same data
• Log thread data sharing read/write events
• Exclude known harmless evevents
• Supports pthread, OpenMP*, Intel® Cilk™ Plus and Intel® Threadin gBuilding Blocks
Don't forget to read the full tutorial with in-depth descriptions of the Intel® Debuggeruse cases. The full tutorial is available as an attachment to this article IDB_Linux_12.pdf.