# Debug Kotlin coroutines

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/idea/llms.txt).

> **TL;DR**
> Required plugin: Kotlin (bundled)

While coroutines are particularly well suited for asynchronous programming, there is still room for mistakes, which may be hard to figure out due to the challenges that the asynchronous flow poses.

When debugging Kotlin code, IntelliJ IDEA allows you to suspend the execution and diagnose problems that the code in coroutines may have. The debug information is available even if the coroutine is not running at the moment.

Learn more in the [Kotlin documentation](https://kotlinlang.org/docs/coroutines-debugging.html).

## Inspect coroutines

Procedure:

1. Set a [breakpoint](using-breakpoints.html) in or near the coroutine code.

2. Start the application in debug mode.

3. Wait until the application reaches the breakpoint.

4. In the Debug tool window, select the Coroutines tab from the Layout Settings.

The view groups coroutines by their dispatchers. Expand a dispatcher node to see its coroutines.

![Coroutines grouped by dispatcher in the Coroutines tab](https://resources.jetbrains.com/help/img/idea/2026.2/kotlin_debug_coroutines_list.png)

For each coroutine, IntelliJ IDEA displays its current state:

* CREATED: The coroutine is created but is not running.

* RUNNING: The coroutine is currently executing.

* SUSPENDED: The coroutine is paused and is not currently executing on a thread.

Where applicable, the view also shows information about the thread on which a coroutine is executing.

## Examine a coroutine

In the Coroutines tab, you can see a full coroutine creation stack, as well as a call stack inside the coroutine. The stack includes all frames with variable values, even those that would be lost during standard debugging.

![The coroutine creation stack](https://resources.jetbrains.com/help/img/idea/2026.2/kotlin_debug_coroutines_frames.png)

When debugging coroutines, you can use all the standard functionality of the Variables tab. For more information about using the Variables tab, refer to the [Examine/update variables](examining-suspended-program.html#variables) topic.

![Variables tab for a coroutine](https://resources.jetbrains.com/help/img/idea/2026.2/kotlin_debug_coroutines_context.png)

If you are not interested in calls in Kotlin classes, you can hide them by clicking Hide Frames from Libraries in the top-right corner of the Frames tab.

![Hide calls in Kotlin classes](https://resources.jetbrains.com/help/img/idea/2026.2/kotlin_debug_coroutines_frames_f.png)

> **Tip:**
> When examining the internal operations of a coroutine, you can also use other analysis aids like watches and arbitrary expression evaluation.

## Capture a thread and coroutine dump

If you need a report containing the state of each coroutine and its stack, use a [thread dump](thread-dumps.html).

IntelliJ IDEA's thread dumps can include:

* Java platform threads

* Virtual threads

* Detected Kotlin coroutines and their stacks

Procedure: Get coroutines dump

* On the Debug tool window's toolbar, click ![More](https://resources.jetbrains.com/help/img/idea/2026.2/app-client.expui.general.moreVertical.svg) More, then select ![](https://resources.jetbrains.com/help/img/idea/2026.2/app.actions.dump.svg) Get Thread Dump.

![The More button on the Debug tool window toolbar](https://resources.jetbrains.com/help/img/idea/2026.2/ij_debug_more.png)

