The IDE works with the GNU Debugger (GDB) and many runtime analysis tools that find memory errors. It can display kernel event trace data (through the System Profiler) and target state information (through System Information). It also works with the Application Profiler, which reports function runtimes.
System Information, GDB, and the System Profiler are helpful in all debugging use cases—improper program results, process hanging, and process crashing. The last two tools can be used concurrently with the memory-analyzing and profiling tools, which find more specific problems.
To detect the cause of a process hanging, the Application Profiler and System Information are helpful.
Tool | Debugging capabilities | Use cases | Advantages | Drawbacks |
---|---|---|---|---|
Application Profiler | When run in sampling mode, takes snapshots of a program's execution position (i.e., the current address being executed) at regular intervals. The execution positions provide a summary of where in the code the program is spending most of its time. | Process hanging |
|
|
GDB |
Lets you step through the code to see which paths are followed, how variable values change over time, and whether certain lines of code are reached. You can also debug core files, to see what a program was doing when it crashed. |
Improper program results Process hanging Process crashing |
|
|
Memory Analysis | Tracks allocation and deallocation operations and provides data to the IDE so it can report memory leaks and other common errors such as buffer overruns. | Improper program results Process crashing |
|
|
System Information | This IDE perspective provides memory, CPU, and resource usage data about the processes on a target. It also displays thread states, so you can see if a process is hanging because one of its threads is blocked or busy. | Process hanging |
|
|
System Profiler | Displays event data generated by the instrumented kernel running on a target. These data include process- and thread-level metrics on CPU consumption, execution times, and the number of messages sent, which gives you an idea of the event sequence behind a program failure. | Improper program results Process hanging Process crashing |
|
|
Valgrind Helgrind | Finds thread synchronization problems in programs that use pthreads, by detecting memory locations accessed by more than one thread but without proper locking or synchronization. | Improper program results Process crashing |
|
|
Valgrind Massif | Takes regular heap snapshots and outputs data describing heap usage over time and where most memory is being allocated. These data let you see which functions use too much memory as well as the heap contents any time the program crashed. | Improper program results Process crashing |
|
|
Valgrind Memcheck | Detects memory management problems by checking all reads and writes of memory. This tool finds memory leaks, bad frees, overlapping blocks in source and destination pointers, use of uninitialized values, and accesses to improper memory regions. | Improper program results Process crashing |
|
|