This is an archive of the discontinued LLVM Phabricator instance.

Fix temporary directory computation on linux (pr25147)
ClosedPublic

Authored by labath on Oct 15 2015, 7:51 AM.

Details

Summary

On linux, the environment variables for temp directories that lldb checks for are generally not
defined, and the temp directory computation failed. This caused expression evaluation to fall
back to creating "/tmp/lldb-*.expr" debugging files instead of the usual
"$TMP/lldb/pid/lldb-*.expr". Crucially, these files were not cleaned up on lldb exit, which
caused clutter in the /tmp folder, especially on long-running machines (e.g. builtbots). This
commit fixes lldb to use llvm::sys::path::system_temp_directory, which does the same environment
variable dance, but (!) also falls back to the P_tmpdir macro, which is how the temp directory is
defined on linux.

Since the linux temp path computation now succeeds, I needed to also modify Android path
computation to check for actual directory existence, rather then checking whether the operation
failed.

Diff Detail

Event Timeline

labath updated this revision to Diff 37485.Oct 15 2015, 7:51 AM
labath retitled this revision from to Fix temporary directory computation on linux (pr25147).
labath updated this object.
labath added reviewers: clayborg, tberghammer.
labath added subscribers: emaste, lldb-commits.
clayborg accepted this revision.Oct 15 2015, 9:40 AM
clayborg edited edge metadata.
This revision is now accepted and ready to land.Oct 15 2015, 9:40 AM
This revision was automatically updated to reflect the committed changes.