This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix that symbols.clang-modules-cache-path is never initialized
ClosedPublic

Authored by teemperor on Dec 7 2020, 9:47 AM.

Details

Summary

LLDB is supposed to ask the Clang Driver what the default module cache path is and
then use that value as the default for the symbols.clang-modules-cache-path setting.
However, we use the property type String to change symbols.clang-modules-cache-path
even though the type of that setting is FileSpec, so the setter will simply do nothing and
return false. We also don't check the return value of the setter, so this whole code ends up
not doing anything at all.

This changes the setter to use the correct property type and adds an assert that we actually
successfully set the default path. Also adds a test that checks that the default value for this
setting is never unset/empty path as this would effectively disable the import-std-module
feature from working by default.

Diff Detail

Event Timeline

teemperor requested review of this revision.Dec 7 2020, 9:47 AM
teemperor created this revision.

I had to add a lldb-noinit alias that creates a completely uninitialized lldb (as the default init file for the tests sets a cache path).

JDevlieghere accepted this revision.Dec 7 2020, 12:59 PM

LGTM

lldb/source/Core/ModuleList.cpp
85–87

nit: no braces

This revision is now accepted and ready to land.Dec 7 2020, 12:59 PM
shafik accepted this revision.Dec 8 2020, 11:20 AM
shafik added a subscriber: shafik.

LGTM

Herald added a project: Restricted Project. · View Herald TranscriptDec 10 2020, 4:38 AM