aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/commands/process/attach/main.cpp
blob: 034e80ed5f2b37f5d42dda92f2fa6feb3ec4f844 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "attach.h"
#include <chrono>
#include <cstdio>
#include <thread>

volatile int g_val = 12345;

int main(int argc, char const *argv[]) {
    int temp;
    lldb_enable_attach();

    // Waiting to be attached by the debugger.
    temp = 0;

    while (temp < 30) {
        std::this_thread::sleep_for(std::chrono::seconds(2)); // Waiting to be attached...
        temp++;
    }

    printf("Exiting now\n");
}