This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Use realpath to avoid issues with symlinks in source paths
Needs ReviewPublic

Authored by aadsm on Dec 1 2019, 8:51 PM.

Details

Summary

I was not able to sucessfully run TestDSYMSourcePathRemapping.py because the source mapping was using /tmp/ but the debugger was checking /private/tmp (which is a symlink to tmp). Maybe the debugger should realpath on it? Not sure but by making sure our tests always use the real path it avoids these kind of issues.

Event Timeline

aadsm created this revision.Dec 1 2019, 8:51 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2019, 8:51 PM

Might be a better idea to realpath this once in the setup code instead of calling realpath thousands and thousands of times? Maybe we just santize "LLDB_TEST" and "LLDB_BUILD" one time with top level code like:

os.environ["LLDB_TEST"] = os.path.realpath(os.environ["LLDB_TEST"])
os.environ["LLDB_BUILD"] = os.path.realpath(os.environ["LLDB_BUILD"])
aadsm updated this revision to Diff 231740.Dec 2 2019, 11:14 AM

Solve this at the failing test level. We can't be sure of the filename will end up in the debug info so we just add both keys to the mapping.

lanza resigned from this revision.Aug 13 2021, 11:53 AM
wallace resigned from this revision.Aug 13 2021, 11:55 AM