IntelliJ IDEA 14.1.0 Help

Debugging

Overview

This section describes the procedures that are common for various types of applications.

For details related to debugging applications in the supported frameworks, refer to the Language and Framework-Specific Guidelines

IntelliJ IDEA provides a complete range of facilities to debug source code:

  • Breakpoints in Java.
  • Breakpoints in JavaScript.
  • Customizable breakpoint properties: conditions, pass count, etc.
  • Frames, variables, and watches views in the debugger UI.
  • Runtime evaluation of expressions.

General debugging steps

To debug an application, perform the following general steps

  1. Configure the dependencies and libraries to be passed to the compiler and generate the debugging information.
  2. Configure common debugger behavior, including stepping speed, class reloading policy, or scrolling of the editor canvas.
  3. Configure debugger options.
  4. To debug CoffeeScript, TypeScript, and Dart code, you need source maps generated in addition to the JavaScript code. Source maps set correspondence between lines in your original code and in the generated JavaScript code, otherwise your breakpoints will not be recognised and processed correctly.

    JavaScript and source maps are generated by transpiling the original code manually using the File Watcher of the corresponding type (CoffeeScript, TypeScript, or Dart. After that you can debug the output JavaScript code.

    For details, see Using File Watchers, Transpiling CoffeeScript to JavaScript, and Transpiling TypeScript to JavaScript.

  5. Define a run/debug configuration for the application to be debugged.
  6. Create breakpoints in the source code.
  7. Launch a debugging session.
  8. Pause or resume the debugging session as required.
  9. During the debugger session, step through the breakpoints, evaluate expressions, change values on-the-fly , examine suspended program, explore frames, set watches , reload classes, and customize views .

Note that IntelliJ IDEA lets you debug decompiled code in the same way as your normal source files, provided that it contains line number attributes.

See Also

Last modified: 14 July 2015