Files
clang-p2996/lldb/test/API/commands/process/attach/main.cpp
Michał Górny dbfdb139f7 [lldb] [POSIX-DYLD] Update the cached exe path after attach
Fix the POSIX-DYLD plugin to update the cached executable path after
attaching.  Previously, the path was cached in DYLDRendezvous
constructor and not updated afterwards.  This meant that if LLDB was
attaching to a process (e.g. via connecting to lldb-server), the code
stored the empty path before DidAttach() resolved it.  The fix updates
the cached path in DidAttach().

This fixes a new instance of https://llvm.org/pr17880

Differential Revision: https://reviews.llvm.org/D92264
2020-12-17 09:31:22 +01:00

23 lines
403 B
C++

#include <stdio.h>
#include <chrono>
#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) // Waiting to be attached...
{
std::this_thread::sleep_for(std::chrono::seconds(2));
temp++;
}
printf("Exiting now\n");
}