teak-llvm/lldb/packages/Python/lldbsuite/test/functionalities/process_attach/main.cpp
Pavel Labath d0f89cd721 Centralize the handling of attach permissions on linux in tests
Summary:
On linux we need the process to give us special permissions before we can attach to it.
Previously, the code for this was copied into every file that needed it. This moves the code to a
central place to reduce code duplication.

Reviewers: clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D15992

llvm-svn: 257319
2016-01-11 10:24:50 +00:00

21 lines
374 B
C++

#include <stdio.h>
#include <chrono>
#include <thread>
int main(int argc, char const *argv[]) {
int temp;
lldb_enable_attach();
// Waiting to be attached by the debugger.
temp = 0;
while (temp < 30) // Waiting to be attached...
{
std::this_thread::sleep_for(std::chrono::seconds(2));
temp++;
}
printf("Exiting now\n");
}