This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add `source cache dump` and `source cache clear` subcommand
ClosedPublic

Authored by JDevlieghere on Jun 23 2023, 10:39 PM.

Details

Summary

Add two new source subcommands: source cache dump and source cache clear. As the name implies the first one dumps the source cache while the later clears the cache.

This patch was motivated by a handful of (internal) bug reports related to sources not being available. Right now those issues can be hard to diagnose. The new commands give users, as well as us as developers, more insight into and control over the source cache.

Diff Detail

Event Timeline

JDevlieghere created this revision.Jun 23 2023, 10:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 23 2023, 10:39 PM
JDevlieghere requested review of this revision.Jun 23 2023, 10:39 PM
jasonmolenda accepted this revision.Jun 25 2023, 6:17 PM

LGTM

lldb/source/Commands/CommandObjectSource.cpp
1208

Do you want to split this across two lines? I don't think there should be a newline here.

1227

I don't think the newline is necessary/should be here.

1266

Maybe we can make this less accurate and easier to understand. like "Commands for examining source files in the current process".

lldb/source/Core/SourceManager.cpp
738

m/d/Y would be dope tho

This revision is now accepted and ready to land.Jun 25 2023, 6:17 PM
JDevlieghere marked 4 inline comments as done.Jun 26 2023, 9:14 AM
JDevlieghere added inline comments.
lldb/source/Commands/CommandObjectSource.cpp
1266

But that wouldn't just be less accurate, it would be wrong. The current cache is shared across targets and processes belonging to the same debugger.

lldb/source/Core/SourceManager.cpp
738

🇺🇸

This revision was automatically updated to reflect the committed changes.
JDevlieghere marked 2 inline comments as done.
Herald added a project: Restricted Project. · View Herald TranscriptJun 26 2023, 10:40 AM