What this tutorial is about

This tutorial aims to walk you step-by-step through debugging a Java application with Chronon.

What this tutorial is not about

The basics of Java programming, and using Chronon are out of scope of this tutorial. Refer to the Chronon documentation for details.

Before you start...

Make sure that:

It is essential to understand that Chronon is not literally a debugger - it only helps you record the execution progress and then play it back, like a videotape.

Preparing example

Let’s see how Chronon works on a simple example of the two-threaded array sorting, where one thread performs quicksort, and the other one does bubble sorting. The project consists of three classes.
The first one is the class

ChrononDemo.java

:

package demo;

import org.jetbrains.annotations.NotNull;

import java.util.AbstractMap;
import java.util.Arrays;
import java.util.Random;

public class ChrononDemo {

    public static final int SIZE = 1000;
    public static final Random GENERATOR = new Random();

    public static void main(String[] args) throws InterruptedException {
        final int[] array = new int[SIZE];
        for (int i = 0; i < SIZE; i++) {
            array[i] = GENERATOR.nextInt();
        }
        final Thread quickSortThread = new Thread(new Runnable() {
            @Override
            public void run() {
                QuickSort.sort(Arrays.copyOf(array, array.length));
            }
        }, "Quick sort");

        final Thread bubbleThread = new Thread(new Runnable() {
            @Override
            public void run() {
                BubbleSort.sort(Arrays.copyOf(array, array.length));
            }
        }, "Bubble sort");

        quickSortThread.start();
        bubbleThread.start();

        quickSortThread.join();
        bubbleThread.join();
    }
}

Installing plugin

Changes to the UI

Creating Chronon run/debug configuration.

Defining include/exclude patterns

Launching the application with Chronon