This is an archive of the discontinued LLVM Phabricator instance.

[lldb/Support] Treat empty FileSpec as an invalid file.
ClosedPublic

Authored by JDevlieghere on Apr 2 2020, 5:15 PM.

Details

Summary

LLDB relies on empty FileSpecs being invalid files, for example, they don't exists. Currently this assumption does not always hold during reproducer replay, because we pass the result of GetPath to the VFS. This is an empty string, which the VFS converts to an absolute directory by prepending the current working directory, before looking it up in the YAML mapping. This means that an empty FileSpec will exist when the current working directory does. This breaks at least one test (TestAddDsymCommand.py) when ran from replay.

This patch special cases empty FileSpecs and returns a sensible result before calling GetPath and forwarding the call.

Diff Detail

Repository
rLLDB LLDB

Event Timeline

JDevlieghere created this revision.Apr 2 2020, 5:15 PM
labath accepted this revision.Apr 3 2020, 12:22 AM
This revision is now accepted and ready to land.Apr 3 2020, 12:22 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2020, 9:41 AM