yuvald-sweet-security wrote:

> Kind of yes, but the two issues are related. The issue with symlinks is that 
> once you resolve them, there's no way to go back. I'm asking why (in the 
> scenario you describe in that PR) does `GetModuleFileSpecForHostAddress` 
> return "lldb-server-19" (instead of "/usr/bin/lldb-server-19" or 
> "/usr/lib/llvm-19/bin/lldb-server")

So, regarding that issue - first of all, `GetModuleFileSpecForHostAddress` 
doesn't follow symlinks. I'm not sure if that's a bug or intended behavior but 
I don't see anything in `FileSystem::Resolve` that attempts to follow symlinks 
- it just makes a relative or `~`-path absolute.

Now, what you said about resolving relative to cwd instead of relative to $PATH 
also happens there, but that's actually the reason the entire thing works in 
the first place - the fact that this resolves relative to cwd causes 
`ComputePathRelativeToLibrary` to fail and then `ComputeSupportExeDirectory` 
falls back to using `GetProgramFileSpec`. So, this bug masks the first bug. 

https://github.com/llvm/llvm-project/pull/131519
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to