@@ -57,3 +57,50 @@ def test_platform_process_connect(self):
57
57
self .assertEqual (frame .GetFunction ().GetName (), "main" )
58
58
self .assertEqual (frame .FindVariable ("argc" ).GetValueAsSigned (), 2 )
59
59
process .Continue ()
60
+
61
+ @skipIfRemote
62
+ @expectedFailureAll (hostoslist = ["windows" ], triple = ".*-android" )
63
+ @skipIfDarwin # lldb-server not found correctly
64
+ @expectedFailureAll (oslist = ["windows" ]) # process modules not loaded
65
+ # lldb-server platform times out waiting for the gdbserver port number to be
66
+ # written to the pipe, yet it seems the gdbserver already has written it.
67
+ @expectedFailureAll (
68
+ archs = ["aarch64" ],
69
+ oslist = ["freebsd" ],
70
+ bugnumber = "https://github.com/llvm/llvm-project/issues/84327" ,
71
+ )
72
+ @add_test_categories (["lldb-server" ])
73
+ def test_platform_process_connect_with_unix_connect (self ):
74
+ self .build ()
75
+ import time
76
+
77
+ timestamp = int (time .time ())
78
+ listen_url = "/tmp/listen_url_%s" % timestamp
79
+ port_file = "/tmp/port_file_%s" % timestamp
80
+ commandline_args = [
81
+ "platform" ,
82
+ "--listen" ,
83
+ listen_url ,
84
+ "--socket-file" ,
85
+ port_file ,
86
+ "--" ,
87
+ self .getBuildArtifact ("a.out" ),
88
+ "foo" ,
89
+ ]
90
+ self .spawnSubprocess (lldbgdbserverutils .get_lldb_server_exe (), commandline_args )
91
+
92
+ socket_file = lldbutil .wait_for_file_on_target (self , port_file )
93
+ new_platform = lldb .SBPlatform ("remote-" + self .getPlatform ())
94
+ self .dbg .SetSelectedPlatform (new_platform )
95
+ connect_url = "unix-connect://%s" % socket_file
96
+ self .runCmd ("platform connect %s" % connect_url )
97
+
98
+ lldbutil .run_break_set_by_symbol (self , "main" )
99
+ process = self .process ()
100
+
101
+ process .Continue ()
102
+
103
+ frame = self .frame ()
104
+ self .assertEqual (frame .GetFunction ().GetName (), "main" )
105
+ self .assertEqual (frame .FindVariable ("argc" ).GetValueAsSigned (), 2 )
106
+ process .Continue ()
0 commit comments