mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-24 05:55:43 -04:00

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
21 lines
374 B
C++
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");
|
|
}
|