<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/120057>120057</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Support Full Path Matching for Process Selection in LLDB attach Command
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
suxiaogang223
</td>
</tr>
</table>
<pre>
Description:
When attempting to use LLDB to attach to a process by name, I encountered a situation where multiple processes share the same name but differ in their full paths. LLDB currently only considers the process name, which leads to ambiguity and prevents me from attaching to the intended process.
Here is the specific scenario:
```text
Could not attach: more than one process named /mnt/disk2/suyiteng/output/be/lib/doris_be:
PID PARENT USER TRIPLE ARGUMENTS
====== ====== ========== ============================== ============================
1026195 1 suyiteng x86_64-*-linux-gnu /mnt/disk2/suyiteng/output21/be/lib/doris_be
3306900 1 suyiteng x86_64-*-linux-gnu /mnt/disk2/suyiteng/output/be/lib/doris_be
```
As shown, both processes are named doris_be, but their paths differ:
1. /mnt/disk2/suyiteng/output21/be/lib/doris_be
2. /mnt/disk2/suyiteng/output/be/lib/doris_be
The paths provide a clear distinction between the two processes, and being able to select based on the full path would resolve this issue.
Proposed Feature:
Enhance the attach command to support full path matching for process selection. For example:
• If provided with a full path, LLDB should match processes by their executable path.
• If a partial path is provided, LLDB could match based on a substring of the path for additional flexibility.
Benefit:
This feature would significantly improve the usability of LLDB in environments where processes with the same name exist in different directories, which is a common scenario in development and debugging workflows.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0Vttu3DYQ_Rruy8ALitqL90EPSuxtDSSBYTvoY0BJI2kaihR42cvfF6S0a6do2hRBBAErLDW3M2fOSDpHnUYs2PodW98tZPC9sYULJ5Kmk7oTIl9UpjkXd-hqS6Mno1leMl7-0aMG6T0OoyfdgTcQHMKHD3fv4rP0XtZ9eoLRmhqdg-oMWg7IxHt4ANS1CdqjxQYkOPJB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