[Lldb-commits] [PATCH] D32271: Patch to Attach pid successfully from different dir

Ed Maste via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 19 08:08:58 PDT 2017


emaste added a comment.

In https://reviews.llvm.org/D32271#759361, @dim wrote:

> As I found out in https://reviews.llvm.org/rL303015, the `KERN_PROC_PATHNAME` has one drawback: if an executable file has multiple hard links, you will get just one of its filenames as the result.  Since that filename is more or less randomly chosen, it does *not* have to correspond to the actual `argv[0]` the executable was invoked with.  If that does not matter, this approach is fine, though.


Thanks @dim, it's because of https://reviews.llvm.org/rL303015 that I added you to CC.

Thinking about this further, I think that in this (LLDB) case it's acceptable (even if it might prove slightly surprising). If we attach via `-p <pid>` this code is used to find the corresponding binary, and even if we open the file by the "wrong" name we still have the correct content.


https://reviews.llvm.org/D32271





More information about the lldb-commits mailing list