[Lldb-commits] [PATCH] D65611: [Driver] Expand the target in the driver.

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 5 09:51:01 PDT 2019

clayborg added a comment.

In D65611#1615018 <https://reviews.llvm.org/D65611#1615018>, @JDevlieghere wrote:

> In D65611#1613052 <https://reviews.llvm.org/D65611#1613052>, @clayborg wrote:
> > Also be careful if the user uses a symlink to not resolve the link. If a user tries to debug clang++:
> >
> >   $ ls -AFlG /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang*
> >   -rwxr-xr-x  1 root  wheel  81666656 Jul 12 21:48 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang*
> >   lrwxr-xr-x  1 root  wheel         5 Jul 25 07:57 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++@ -> clang
> >
> >
> > We don't want to resolve it to "clang" or it will change the behavior for any program that checks argv[0] and doesn't something different depending on what that values is.
> That's a good point, and something I hadn't considered. If my memory serves me right `ResolvePath` doesn't call realpath, but I'd have to double check for sure.

Please do!

> One thing I liked about this is that when you're debugging something in your PATH it will show you the absolute path, like `/bin/ls` instead of just `ls`.

This can be nice, but people also have come to expect interesting things from the "argv[0]" over the years. This code is fragile and we do have tests, but we should make sure we have plenty of tests to make sure we don't regress. clang and clang++ should be a good example to use as clang won't enable C++ by default if argv[0] isn't clang++



More information about the lldb-commits mailing list