File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
packages/Python/lldbsuite/test/tools/lldb-server
test/API/tools/lldb-server Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -444,13 +444,20 @@ def launch_process_for_attach(
444
444
if not exe_path :
445
445
exe_path = self .getBuildArtifact ("a.out" )
446
446
447
- args = []
447
+ # This file will be created once the inferior has enabled attaching.
448
+ sync_file_path = lldbutil .append_to_process_working_directory (
449
+ self , "process_ready"
450
+ )
451
+ args = [f"syncfile:{ sync_file_path } " ]
448
452
if inferior_args :
449
453
args .extend (inferior_args )
450
454
if sleep_seconds :
451
455
args .append ("sleep:%d" % sleep_seconds )
452
456
453
- return self .spawnSubprocess (exe_path , args )
457
+ inferior = self .spawnSubprocess (exe_path , args )
458
+ lldbutil .wait_for_file_on_target (self , sync_file_path )
459
+
460
+ return inferior
454
461
455
462
def prep_debug_monitor_and_inferior (
456
463
self ,
Original file line number Diff line number Diff line change 5
5
#include < cstdlib>
6
6
#include < cstring>
7
7
#include < errno.h>
8
+ #include < fstream>
8
9
#include < future>
9
10
#include < inttypes.h>
10
11
#include < memory>
@@ -265,7 +266,11 @@ int main(int argc, char **argv) {
265
266
// Process command line args.
266
267
for (int i = 1 ; i < argc; ++i) {
267
268
std::string arg = argv[i];
268
- if (consume_front (arg, " stderr:" )) {
269
+ if (consume_front (arg, " syncfile:" )) {
270
+ // Write to this file to tell test framework that attaching is now
271
+ // possible.
272
+ std::ofstream (arg).close ();
273
+ } else if (consume_front (arg, " stderr:" )) {
269
274
// Treat remainder as text to go to stderr.
270
275
fprintf (stderr, " %s\n " , arg.c_str ());
271
276
} else if (consume_front (arg, " retval:" )) {
You can’t perform that action at this time.
0 commit comments