Intel® Inspector Help

Investigating Problems Using Interactive Debugging

Sometimes simply knowing the location of a problem is not enough. So the Intel Inspector provides the opportunity to investigate more deeply with an interactive debugging session during analysis.

When you run an interactive debugging session during analysis, the Intel Inspector halts execution at a selected or detected problem. This is more efficient than simply setting a code breakpoint at a reported problem location because the code could execute thousands of times before the conditions that produced the problem occur.

You can choose the supported debugger to use (default is the GNU gdb* debugger). During the debugging session, use the normal commands for the chosen debugger to examine memory, set code breakpoints, and continue execution. Use the command monitor help to view the extended debugger commands provided by the Intel Inspector.

Use one of the following ways to initiate an interactive debugging session during analysis so that you see the state of your application code instead of the state of Intel Inspector analysis code:

Objective

Process Summary

Usage

Allow quick investigation of problem(s) of interest.

In a result, choose a problem(s) in the Summary window, right-click to display a context menu, then choose Debug This Problem.

Outcome: The Intel Inspector:

  • Launches a new analysis, of the same type, optimized to find the selected problem(s).

  • Halts application execution when it detects the selected problem(s) and opens a debugging session.

Typical scenario: After reviewing a problem using result data provided by the Intel Inspector, you discover you need more application state information at the time the problem occurred, such as the contents of variables. The Debug This Problem function returns you to the point of the problem, halting execution in a debugging session so you can examine memory and other state information at any point in the call stack.

Delay problem detection until a selected point in the application.

In the Intel Inspector, select the Select analysis start location with debugger radio button when configuring an analysis. Start the analysis and wait for the debugging session to open. When execution halts at the entry to main(), set a code breakpoint at the point in the application where you want analysis to begin. Continue execution until that point, then enter monitor begin-analysis to turn on analysis and resume execution.

Outcome: Execution halts for each problem detected after you turn on analysis and resume execution. You cannot turn off analysis again.

Typical scenario: You configured the project to limit the application modules for inspection, but you need to narrow analysis focus even further. This option lets you choose an arbitrary location to turn on error detection, allowing faster execution until that point.

Tip

Because debugging in conjunction with a threading analysis significantly slows execution:

  • Use this option only if the area targeted for threading analysis has a very short execution time.

  • For best performance, use the Debug This Problem function to selectively investigate threading issues identified during a non-debug run.

Allow investigation of every detected problem.

In the Intel Inspector, select the Enable debugger when problem detected radio button when configuring an analysis.

Outcome: When you run the analysis, the Intel Inspector halts application execution when it detects the first problem and launches a debugging session. Execution halts for each detected problem when you resume execution using normal debugger commands.

Typical scenario: You want to investigate the state of the application for every problem detected.

Tip

Because of analysis speed issues, this option is not recommended when detecting data races. It is faster to use the Debug This Problem function to selectively investigate threading problems identified during a non-debug run.

Tips

Parent topic:Investigating Results

See Also