[Lldb-commits] [lldb] r350368 - symbols.enable-external-lookup=false on all hosts (not just OSX)

Jan Kratochvil via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 3 15:11:06 PST 2019


Author: jankratochvil
Date: Thu Jan  3 15:11:06 2019
New Revision: 350368

URL: http://llvm.org/viewvc/llvm-project?rev=350368&view=rev
Log:
symbols.enable-external-lookup=false on all hosts (not just OSX)

There is already in use:
	lit/lit-lldb-init:
		settings set symbols.enable-external-lookup false
	packages/Python/lldbsuite/test/lldbtest.py:
		self.runCmd('settings set symbols.enable-external-lookup false')

But those are not in effect during MI part of the testsuite. Another problem is
that symbols.enable-external-lookup (read by GetEnableExternalLookup) has been
currently read only by LocateMacOSXFilesUsingDebugSymbols and therefore it had
no effect on Linux.

On Red Hat platforms (Fedoras, RHEL-7) there is DWZ in use and so
MiSyntaxTestCase-test_lldbmi_output_grammar FAILs due to:
	AssertionError: error: inconsistent pattern ''^.+?\n'' for state 0x5f
	(matched string: warning: (x86_64) /lib64/libstdc++.so.6 unsupported
	DW_FORM values: 0x1f20 0x1f21
It is the only testcase with this error. It happens due to:
	(lldb) target create "/lib64/libstdc++.so.6"
	Current executable set to '/lib64/libstdc++.so.6' (x86_64).
	(lldb) b main
	warning: (x86_64) /lib64/libstdc++.so.6 unsupported DW_FORM values: 0x1f20 0x1f21
	Breakpoint 1: no locations (pending).
	WARNING:  Unable to resolve breakpoint to any actual locations.
which happens only with gcc-base-debuginfo rpm installed (similarly for other packages).

It should also speed up the testsuite as it no longer needs to read
/usr/lib/debug symbols which have no effect (and should not have any effect) on
the testsuite results.

Differential Revision: https://reviews.llvm.org/D55859

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
    lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error
    lldb/trunk/source/Core/ModuleList.cpp
    lldb/trunk/source/Host/common/Symbols.cpp
    lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py?rev=350368&r1=350367&r2=350368&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py Thu Jan  3 15:11:06 2019
@@ -40,7 +40,7 @@ class MiTestCaseBase(Base):
                 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 @@ class MiTestCaseBase(Base):
         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,

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py?rev=350368&r1=350367&r2=350368&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py Thu Jan  3 15:11:06 2019
@@ -237,7 +237,11 @@ class MiStartupOptionsTestCase(lldbmi_te
 
         # 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)

Modified: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error?rev=350368&r1=350367&r2=350368&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/start_script_error Thu Jan  3 15:11:06 2019
@@ -1,2 +1,3 @@
+settings set symbols.enable-external-lookup false
 -file-exec-and-symbols a.out
 -break-ins -f main

Modified: lldb/trunk/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=350368&r1=350367&r2=350368&view=diff
==============================================================================
--- lldb/trunk/source/Core/ModuleList.cpp (original)
+++ lldb/trunk/source/Core/ModuleList.cpp Thu Jan  3 15:11:06 2019
@@ -69,9 +69,16 @@ namespace {
 static constexpr PropertyDefinition g_properties[] = {
     {"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."},
+     "Control the use of external sources to locate symbol files. "
+     "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: "
+     "On macOS, Spotlight would be also used to locate a matching .dSYM "
+     "bundle based on the UUID of the executable. "
+     "On NetBSD, directory /usr/libdata/debug would be also searched. "
+     "On platforms other than NetBSD directory /usr/lib/debug would be "
+     "also searched."
+    },
     {"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr,
      {},
      "The path to the clang modules cache directory (-fmodules-cache-path)."}};

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=350368&r1=350367&r2=350368&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Thu Jan  3 15:11:06 2019
@@ -247,6 +247,8 @@ ModuleSpec Symbols::LocateExecutableObje
   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 @@ FileSpec Symbols::LocateExecutableSymbol
       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();

Modified: lldb/trunk/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=350368&r1=350367&r2=350368&view=diff
==============================================================================
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Thu Jan  3 15:11:06 2019
@@ -3232,7 +3232,8 @@ static constexpr PropertyDefinition g_pr
          "whose paths don't match the local file system."},
     {"debug-file-search-paths", OptionValue::eTypeFileSpecList, false, 0,
      nullptr, {},
-     "List of directories to be searched when locating debug symbol files."},
+     "List of directories to be searched when locating debug symbol files. "
+     "See also symbols.enable-external-lookup."},
     {"clang-module-search-paths", OptionValue::eTypeFileSpecList, false, 0,
      nullptr, {},
      "List of directories to be searched when locating modules for Clang."},




More information about the lldb-commits mailing list