Trace small named C functions as one ordered replay panel.

Callback Step Panel

base
callback_step_panel.c
Replay: real traced execution (multi-file project)
#include <stdio.h>

static int add_step(int value) {
    return value + 4;
}

static int double_step(int value) {
    return value * 2;
}

int main(void) {
    int base = 6;
    int first = add_step(base);
    int second = double_step(first);

    printf("base=%d\n", base);
    printf("first=%d\n", first);
    printf("second=%d\n", second);
    return 0;
}
#include <stdio.h>

static int add_step(int value) {
    return value + 4;
}

static int double_step(int value) {
    return value * 2;
}

int main(void) {
    int base = 3;
    int first = add_step(base);
    int second = double_step(first);

    printf("base=%d\n", base);
    printf("first=%d\n", first);
    printf("second=%d\n", second);
    return 0;
}
#include <stdio.h>

static int add_step(int value) {
    return value + 4;
}

static int double_step(int value) {
    return value * 2;
}

int main(void) {
    int base = 9;
    int first = add_step(base);
    int second = double_step(first);

    printf("base=%d\n", base);
    printf("first=%d\n", first);
    printf("second=%d\n", second);
    return 0;
}
  1. base ← 6

    11int main(void) {12    int base→ 6 = 6; //@base=3, 913    int first = add_step(base6);14    int second = double_step(first);
  2. static int add_step(int value)

    3static int add_step(int value6) {4    return value6 + 4;5}
  3. first ← 10

    12int base = 6; //@base=3, 913int first→ 10 = add_step(base6);14int second = double_step(first10);
  4. static int double_step(int value)

    7static int double_step(int value10) {8    return value10 * 2;9}
  5. second ← 20

    13    int first = add_step(base);14    int second→ 20 = double_step(first10);1516    printf("base=%d\n", base6);17    printf("first=%d\n", first10);18    printf("second=%d\n", second20);19    return 0;20}
    outputbase=6
    first=10
    second=20
  1. base ← 3

    11int main(void) {12    int base→ 3 = 3;13    int first = add_step(base3);14    int second = double_step(first);
  2. static int add_step(int value)

    3static int add_step(int value3) {4    return value3 + 4;5}
  3. first ← 7

    12int base = 3;13int first→ 7 = add_step(base3);14int second = double_step(first7);
  4. static int double_step(int value)

    7static int double_step(int value7) {8    return value7 * 2;9}
  5. second ← 14

    13    int first = add_step(base);14    int second→ 14 = double_step(first7);1516    printf("base=%d\n", base3);17    printf("first=%d\n", first7);18    printf("second=%d\n", second14);19    return 0;20}
    outputbase=3
    first=7
    second=14
  1. base ← 9

    11int main(void) {12    int base→ 9 = 9;13    int first = add_step(base9);14    int second = double_step(first);
  2. static int add_step(int value)

    3static int add_step(int value9) {4    return value9 + 4;5}
  3. first ← 13

    12int base = 9;13int first→ 13 = add_step(base9);14int second = double_step(first13);
  4. static int double_step(int value)

    7static int double_step(int value13) {8    return value13 * 2;9}
  5. second ← 26

    13    int first = add_step(base);14    int second→ 26 = double_step(first13);1516    printf("base=%d\n", base9);17    printf("first=%d\n", first13);18    printf("second=%d\n", second26);19    return 0;20}
    outputbase=9
    first=13
    second=26
callback step Small helper functions keep each transformation visible in replay while the program stays in one source panel.