[PATCH] D87657: [DebugInfo] Remove dots from getFilenameByIndex return value
Reid Kleckner via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 25 15:35:08 PDT 2020
rnk added inline comments.
================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:1394
sys::path::append(FilePath, Style, IncludeDir, FileName);
+ sys::path::remove_dots(FilePath, /*remove_dot_dot=*/true, Style);
Result = std::string(FilePath.str());
----------------
I don't think we can remove .. components, that wouldn't respect symlinks. Consider:
```
$ mkdir -p foo/bar/baz
$ ln -s .. foo/bar/foo
$ ls foo/bar/
baz foo
$ ls foo/bar/foo/..
# contents of CWD
```
It would seem better to let the debugger sort it out.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87657/new/
https://reviews.llvm.org/D87657
More information about the llvm-commits
mailing list