Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[lldb] Use file-based synchronization in TestVSCode_attach
The is the best method we have at the moment for attach-style tests.
- Loading branch information
Showing
2 changed files
with
26 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 15 additions & 6 deletions
21
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/main.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
#include <stdio.h> | ||
#include <unistd.h> | ||
|
||
int main(int argc, char const *argv[]) | ||
{ | ||
lldb_enable_attach(); | ||
int main(int argc, char const *argv[]) { | ||
lldb_enable_attach(); | ||
|
||
printf("pid = %i\n", getpid()); | ||
sleep(10); | ||
return 0; // breakpoint 1 | ||
if (argc >= 2) { | ||
// Create the synchronization token. | ||
FILE *f = fopen(argv[1], "wx"); | ||
if (!f) | ||
return 1; | ||
fputs("\n", f); | ||
fflush(f); | ||
fclose(f); | ||
} | ||
|
||
printf("pid = %i\n", getpid()); | ||
sleep(10); | ||
return 0; // breakpoint 1 | ||
} |