Page MenuHomePhabricator

[lldb] Refactor Symbols::DownloadObjectAndSymbolFile
ClosedPublic

Authored by JDevlieghere on Fri, Aug 5, 3:21 PM.

Details

Summary
  • Reduce indentation
  • Extract caching of the DbgShellCommand and the dsymForUUID executable (or equivalent)
  • Check the DBGShellCommands before falling back to /usr/local/bin/dsymForUUID
  • Don't check ~rc/bin/dsymForUUID
  • Improve error reporting
  • Don't cache the value of LLDB_APPLE_DSYMFORUUID_EXECUTABLE

Diff Detail

Event Timeline

JDevlieghere created this revision.Fri, Aug 5, 3:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptFri, Aug 5, 3:21 PM
JDevlieghere requested review of this revision.Fri, Aug 5, 3:21 PM
JDevlieghere edited the summary of this revision. (Show Details)
  • Don't cache the value of LLDB_APPLE_DSYMFORUUID_EXECUTABLE
  • Fix typo
  • Still resolve the LLDB_APPLE_DSYMFORUUID_EXECUTABLE in case it's a relative path
jasonmolenda accepted this revision.Sat, Aug 6, 11:22 PM

LGTM, I was looking at this method last week and had the same idea -- I started on a patch similar to this, but hadn't finished yet.

lldb/source/Symbol/LocateSymbolFileMacOSX.cpp
565–599

I had this conditional also test if LLDB_APPLE_DSYMFORUUID_EXECUTABLE was currently set in the environment, which is equivalent to if the DBGShellCommand was set in the com.apple.DebugSymbol preferences. But as I think through it, I think it's fine -- code is calling Symbol::DownloadObjectAndSymbolFile() when it is wiling to do a potentially expensive search for the debug information almost always - force==true is the default, and all of the important ones we're testing in the testsuite.

This revision is now accepted and ready to land.Sat, Aug 6, 11:22 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMon, Aug 8, 8:14 PM