<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/88515>88515</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
DAP attach by process only matches the filename, not the path.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tristanlabelle
</td>
</tr>
</table>
<pre>
The DAP `attach` request with `program` argument is documented to match the process path:
https://github.com/llvm/llvm-project/blob/3cba3c783ca8712981734ee8ef7f2f56685a7a68/lldb/tools/lldb-dap/package.json#L277
But in practice it only matches on the process filename:
https://github.com/llvm/llvm-project/blob/b4df0da9e8421c8026bd09980b8a6acd7a6ce8c9/lldb/source/Utility/ProcessInfo.cpp#L301
Hence if two processes with the same filename but different paths are running, there will be an ambiguity and attaching will fail, when it should be unambiguous.
![image](https://github.com/llvm/llvm-project/assets/2314287/95a19d3d-1ceb-48ae-adf9-c098e4ce3fb7)
(Originally found with the Swift LLDB variant and reported here: https://github.com/swift-server/vscode-swift/issues/745 , but this is a general lldb-dap issue)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyklNFu7CYQhp-GvUG7sgHb-MIXyVlZrRSpR2r7AAOMbU5ZcAFntW9fYTfJyU2lqDe7xjB4vn_mH0jJzh5xIM0zaa4n2PIS4pCjTRm8A4XO4UkF8xj-WJBen75T0laQM-iFtBWN-PeGKdO7zUvZWWOYI9zKFsR5u6HP1CZqgt6f0dAc6A2yXmhekK4xaEyJrpAXwp9IdSXV05LzmsqKjYSNs83Lpi463AgbnXt9-zuvMfxAnQkblQuKsJFrBVx3kmuQXc16WXdcIEqcuolNTdvKBjpo5X6BKRE5BJf-XZ4NrISNK-i_YMbLjxQ8YfyFdd2R1fH7vGVqPV0j6Gw1Uptp8O5xIGGiwX_imqxDDzf832xKmKky0KMUrNayYq0yVd_LSkloQZsOWo1S9x9sKWxRI2Hjn9k6mx-Ejd-PrH71U7jodS14vKp_xvsFfYGaaL6HNwhMR3ULV4IbvkNRtWVq7DRhLGUuNUwUItK4eW_9TNi3EhSR3q1zVCEFT-Gm7LzZ_KDgDT0ayfr5ODKBdSXqvqAv0qYlbM6UyM0fgWFLl58TJqwmzbO9wYykuRImvywwpIS5NAHjtWCyI2zsG6h7w8251qjOQgKewUz9WVe9RKGRT6ojrP-ch_wt2tl6cO5Bp7B586Ha73c7Zfrycn2mrxAt-LzDR1xDLJYoGhH-RP8j91SuOCeMrxgJG1-TDgbP-1vCRpvShoWhEw0tApbK5MWm4j2gM3qM4Ohbm9P9PGH9yQzc9LyHEw51sQyvuBCnZTCMNbxvUCslhaqBT13Va8FE2_dKyvZkB1YxUYma1bzpK3FRAhrDayGNqmvBgIgKb2Ddpch9CXE-7R8dpGzq5rQPlrQPHcY83t8yYmUGxWEvkdrmRETlbMrp45Zss8OhzKGjd6h6vLvtkxOL8O_2Y9-oD_mwJuTlctqiG77cKu8y7xD_BAAA___UbLLM">