jankratochvil updated this revision to Diff 179028. jankratochvil added a comment. Herald added a subscriber: krytarowski.
Updated symbols.enable-external-lookup description in detail. Repository: rLLDB LLDB CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55859/new/ https://reviews.llvm.org/D55859 Files: packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error source/Core/ModuleList.cpp source/Host/common/Symbols.cpp
Index: source/Host/common/Symbols.cpp =================================================================== --- source/Host/common/Symbols.cpp +++ source/Host/common/Symbols.cpp @@ -247,6 +247,8 @@ return result; } +// Keep "symbols.enable-external-lookup" description in sync with this function. + FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) { FileSpec symbol_file_spec = module_spec.GetSymbolFileSpec(); if (symbol_file_spec.IsAbsolute() && @@ -270,30 +272,33 @@ debug_file_search_paths.AppendIfUnique(file_spec); } - // Add current working directory. - { - FileSpec file_spec("."); - FileSystem::Instance().Resolve(file_spec); - debug_file_search_paths.AppendIfUnique(file_spec); - } + if (ModuleList::GetGlobalModuleListProperties().GetEnableExternalLookup()) { + + // Add current working directory. + { + FileSpec file_spec("."); + FileSystem::Instance().Resolve(file_spec); + debug_file_search_paths.AppendIfUnique(file_spec); + } #ifndef _WIN32 #if defined(__NetBSD__) - // Add /usr/libdata/debug directory. - { - FileSpec file_spec("/usr/libdata/debug"); - FileSystem::Instance().Resolve(file_spec); - debug_file_search_paths.AppendIfUnique(file_spec); - } + // Add /usr/libdata/debug directory. + { + FileSpec file_spec("/usr/libdata/debug"); + FileSystem::Instance().Resolve(file_spec); + debug_file_search_paths.AppendIfUnique(file_spec); + } #else - // Add /usr/lib/debug directory. - { - FileSpec file_spec("/usr/lib/debug"); - FileSystem::Instance().Resolve(file_spec); - debug_file_search_paths.AppendIfUnique(file_spec); - } + // Add /usr/lib/debug directory. + { + FileSpec file_spec("/usr/lib/debug"); + FileSystem::Instance().Resolve(file_spec); + debug_file_search_paths.AppendIfUnique(file_spec); + } #endif #endif // _WIN32 + } std::string uuid_str; const UUID &module_uuid = module_spec.GetUUID(); Index: source/Core/ModuleList.cpp =================================================================== --- source/Core/ModuleList.cpp +++ source/Core/ModuleList.cpp @@ -70,8 +70,22 @@ {"enable-external-lookup", OptionValue::eTypeBoolean, true, true, nullptr, {}, "Control the use of external tools or libraries to locate symbol files. " - "On macOS, Spotlight is used to locate a matching .dSYM bundle based on " - "the UUID of the executable."}, + "Directories listed in target.debug-file-search-paths and directory of " + "the executable are always checked first for separate debug info files. " + "Then depending on this setting:" +#ifdef __APPLE__ + " On macOS, Spotlight would be also used to locate a matching .dSYM " + "bundle based on the UUID of the executable." +#endif +#ifndef _WIN32 +#ifdef __NetBSD__ + " On NetBSD, directory /usr/libdata/debug would be also searched." +#else // !__NetBSD__ + " On platforms other than NetBSD directory /usr/lib/debug would be " + "also searched." +#endif // !__NetBSD__ +#endif // _WIN32 + }, {"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr, {}, "The path to the clang modules cache directory (-fmodules-cache-path)."}}; Index: packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error =================================================================== --- packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error +++ packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error @@ -1,2 +1,3 @@ +settings set symbols.enable-external-lookup false -file-exec-and-symbols a.out -break-ins -f main Index: packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py =================================================================== --- packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py +++ packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py @@ -237,7 +237,11 @@ # Prepared source file sourceFile = self.copyScript("start_script_error") - self.spawnLldbMi(args="--source %s" % sourceFile) + self.spawnLldbMi(args="--source %s" % sourceFile, preconfig=False) + + # After 'settings set symbols.enable-external-lookup false' + self.expect("settings set symbols.enable-external-lookup false") + self.expect("\^done") # After '-file-exec-and-symbols a.out' self.expect("-file-exec-and-symbols %s" % self.myexe) Index: packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py =================================================================== --- packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py +++ packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py @@ -40,7 +40,7 @@ pass Base.tearDown(self) - def spawnLldbMi(self, exe=None, args=None): + def spawnLldbMi(self, exe=None, args=None, preconfig=True): import pexpect self.child = pexpect.spawn("%s --interpreter %s" % ( self.lldbMiExec, args if args else ""), cwd=self.getBuildDir()) @@ -49,6 +49,10 @@ self.child.logfile_read = open(self.mylog, "w") # wait until lldb-mi has started up and is ready to go self.expect(self.child_prompt, exactly=True) + if preconfig: + self.runCmd("settings set symbols.enable-external-lookup false") + self.expect("\^done") + self.expect(self.child_prompt, exactly=True) if exe: self.runCmd("-file-exec-and-symbols \"%s\"" % exe) # Testcases expect to be able to match output of this command,
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits