hanchenye-llvm-project/lldb/source/Host/common
Jason Molenda 8825c5c9b4 Re-commit the (fixed) changes from r248985 which were reverted by Pavel
when they introduced android testsuite regressions.  Pavel has run the
testsuite against the updated patch and it completes cleanly now.

The original commit message:


Fixing a subtle issue on Mac OS X systems with dSYMs (possibly
introduced by r235737 but I didn't look into it too closely).

A dSYM can have a per-UUID plist in it which tells lldb where
to find an executable binary for the dSYM (DBGSymbolRichExecutable)
- other information can be included in this plist, like how to
remap the source file paths from their build pathnames to their
long-term storage pathnames.

This per-UUID plist is a unusual; it is used probably exclusively
inside apple with our build system.  It is not created by default
in normal dSYMs.

The problem was like this:

  1. lldb wants to find an executable, given only a UUID
     (this happens when lldb is doing cross-host debugging
      and doesn't have a copy of the target system's binaries)

  2. It eventually calls LocateMacOSXFilesUsingDebugSymbols
     which does a spotlight search for the dSYM on the local
     system, and failing that, tries the DBGShellCommands
     command to find the dSYM.

  3. It gets a dSYM.  It reads the per-UUID plist in the dSYM.
     The dSYM has a DBGSymbolRichExecutable kv pair pointing to
     the binary on a network filesystem.

  4. Using the binary on the network filesystem, lldb now goes
     to find the dSYM.

  5. It starts by looking for a dSYM next to the binary it found.

  6. lldb is now reading the dSYM over a network filesystem,
     ignoring the one it found on its local filesystem earlier.

Everything still *works* but it's much slower.

This would be a tricky one to write up in a testsuite case;
you really need the binary to not exist on the local system.
And LocateMacOSXFilesUsingDebugSymbols will only compile on
Mac OS X - even if I found a way to write up a test case, it
would not run anywhere but on a mac.

One change Greg wanted while I was touching this code was to
have LocateMacOSXFilesUsingDebugSymbols (which could be asked
to find a binary OR find a dSYM) to instead return a ModuleSpec
with the sum total of everything it could find.  This
change of passing around a ModuleSpec instead of a FileSpec
was percolated up into ModuleList::GetSharedModule.

The changes to LocateMacOSXFilesUsingDebugSymbols look larger
than they really are - there's a lot of simple whitespace changes
in there.

I ran the testsuites on mac, no new regressions introduced

<rdar://problem/21993813> 

llvm-svn: 249755
2015-10-08 21:48:35 +00:00
..
Condition.cpp
Editline.cpp Refactor many file functions to use FileSpec over strings. 2015-05-29 19:52:29 +00:00
File.cpp Refactor many file functions to use FileSpec over strings. 2015-05-29 19:52:29 +00:00
FileCache.cpp
FileSpec.cpp Moved ResolveSymbolicLink() to the FileSystem where it belongs, thanks 2015-09-18 22:24:57 +00:00
FileSystem.cpp Add qModuleInfo request in order to get module information (uuid, triple,..) by module path from remote platform. 2015-02-25 22:15:44 +00:00
GetOptInc.cpp Move GetOptInc to the common namespace 2015-09-04 09:06:15 +00:00
Host.cpp Fix for build errors on arm-linux-gnueabi-gcc 2015-08-09 19:04:41 +00:00
HostInfoBase.cpp Moved ResolveSymbolicLink() to the FileSystem where it belongs, thanks 2015-09-18 22:24:57 +00:00
HostNativeThreadBase.cpp
HostProcess.cpp
HostThread.cpp
IOObject.cpp
LockFileBase.cpp Use file locks to synchronize access to ModuleCache. 2015-05-07 15:28:49 +00:00
MonitoringProcessLauncher.cpp
Mutex.cpp Disable mutex error checking so it doesn't create problems with the multi-threaded test case. The error would cause an assertion that could cause lldb to crash when unlocking a mutex returned an error because it was in use. 2015-07-23 23:32:08 +00:00
NativeBreakpoint.cpp Moving header files from source/Host/common to proper location. 2015-02-03 01:51:38 +00:00
NativeBreakpointList.cpp Remove trap code from disassembly. 2015-04-29 17:24:48 +00:00
NativeProcessProtocol.cpp [NativeProcessLinux] Integrate MainLoop 2015-07-21 13:20:32 +00:00
NativeRegisterContext.cpp [LLDB][MIPS] Handle false positives for MIPS hardware watchpoints 2015-08-13 03:44:09 +00:00
NativeRegisterContextRegisterInfo.cpp Moving header files from source/Host/common to proper location. 2015-02-03 01:51:38 +00:00
NativeThreadProtocol.cpp Moving header files from source/Host/common to proper location. 2015-02-03 01:51:38 +00:00
NativeWatchpointList.cpp Implement setting and clearing watchpoints. 2015-02-03 01:51:47 +00:00
OptionParser.cpp Revert "Fix warnings found with clang-cl." 2015-02-25 19:52:41 +00:00
PipeBase.cpp Revert "Add Pipe::WriteWithTimeout method" 2015-07-21 11:04:52 +00:00
ProcessRunLock.cpp
Socket.cpp NetBSD ships with paccept(2), a superset of accept4(2) 2015-09-03 17:11:31 +00:00
SocketAddress.cpp freeaddrinfo(NULL) segfaults on Android. 2015-07-17 19:12:33 +00:00
SoftwareBreakpoint.cpp Fix a variety of typos. 2015-06-18 05:27:05 +00:00
StringConvert.cpp Make the "lldb/Utility/JSON.h" able to parse JSON into tokens with the new JSONParser class. 2015-07-06 23:40:40 +00:00
Symbols.cpp Re-commit the (fixed) changes from r248985 which were reverted by Pavel 2015-10-08 21:48:35 +00:00
Terminal.cpp Fix warnings generated by clang-cl. 2015-04-02 20:57:38 +00:00
ThisThread.cpp Simplify find_first_of & find_last_of on single char. 2015-09-01 23:57:17 +00:00
ThreadLauncher.cpp If lldb is being built with ASAN instrumentation, have lldb 2015-01-29 06:28:36 +00:00
TimeValue.cpp
XML.cpp Fix warnings detected by -Wpessimizing-move 2015-07-28 09:18:32 +00:00