Replay one C execution that builds a request in the client file, calls a worker helper in another translation unit, and prints the returned response.

source panels Each source file has its own panel because both files participate in the same execution trace. The Variables panel follows the call from the client file into the worker file and then back to the caller.
boundary The client file owns the entry point and visible output. The worker file owns the response rule for each command.

Project Entry

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

const char *handle_request(int command);

int main(void) {
    int command = 1;
    int requestId = 42;
    const char *name = "status";

    if (command == 0) {
        name = "build";
    } else if (command == 2) {
        name = "deploy";
    }

    const char *response = handle_request(command);
    int ticket = requestId + command;

    if (ticket > 0) {
        puts(name);
    }
    puts(response);
    return 0;
}
#include <stdio.h>

const char *handle_request(int command);

int main(void) {
    int command = 0;
    int requestId = 42;
    const char *name = "status";

    if (command == 0) {
        name = "build";
    } else if (command == 2) {
        name = "deploy";
    }

    const char *response = handle_request(command);
    int ticket = requestId + command;

    if (ticket > 0) {
        puts(name);
    }
    puts(response);
    return 0;
}
#include <stdio.h>

const char *handle_request(int command);

int main(void) {
    int command = 2;
    int requestId = 42;
    const char *name = "status";

    if (command == 0) {
        name = "build";
    } else if (command == 2) {
        name = "deploy";
    }

    const char *response = handle_request(command);
    int ticket = requestId + command;

    if (ticket > 0) {
        puts(name);
    }
    puts(response);
    return 0;
}
  1. command ← 0x1, requestId ← 0x2a, name ← ⟨addr A⟩

    5int main(void) {6    int command→ 0x1 = 1; //@command=0, 27    int requestId→ 0x2a = 42;8    const char *name→ ⟨addr A⟩ = "status";910    if (command == 0) {11        name = "build";12    } else if (command == 2) {13        name = "deploy";14    }1516    const char *response = handle_request(command1);17    int ticket = requestId + command;
  2. response ← ⟨addr B⟩

    1#include <stdio.h>23const char *handle_request(int command);45int main(void) {6    int command = 1; //@command=0, 27    int requestId = 42;8    const char *name = "status";910    if (command == 0) {11        name = "build";
    values this stepservice ready ⟨addr B⟩response1command
  3. response ← ⟨addr B⟩, ticket ← 0x2b

    16const char *response→ ⟨addr B⟩ = handle_request(command1);17int ticket→ 0x2b = requestId42 + command1;
  4. if (ticket > 0)

    19if (ticket43 > 0) {20    puts(namestatus);21}
  5. puts(response);

    21    }22    puts(responseservice ready);23    return 0;24}