This is a more principled approach to disabling Spotlight .dSYM lookups while running the testsuite, most importantly it also works for the LIT-based tests, which I overlooked in my initial fix (renaming the test build dir to lldb-tests.noindex).
I would rather see this done in a more generic fashion. Any platform should be able to enable/disable external symbol lookups. Maybe make this setting:
(lldb) settings set symbols.enable-external-lookups false
On Darwin this would mean dSYM. Any other platform can skip any symbol lookups that aren't part of the object file or specified inside the object file.
This is great. I think I'm supposed to complain that there isn't a positive test that this flag works. This is in the testsuite, but that will just give a negative signal - that we aren't getting random failures that are maybe due to leaving built test products around on your indexed volumes somewhere.
If we weren't building in a .noindex hierarchy this would be as simple as building the dSYM variant, then moving the dSYM to a subdirectory and making sure we still don't read in the dSYM. But that won't work in a .noindex build. Not sure we should be copying files to people's desktops. /tmp/ won't work because Spotlight doesn't index there. We talked briefly about having an indexed directory for test products as well as a no index one, which you could then use for that purpose.
But I'm not sure that this switch is worth that effort. This is fine by me as is.