[Lldb-commits] [lldb] r195681 - Correct a standalone debug file path

Ed Maste emaste at freebsd.org
Mon Nov 25 12:33:56 PST 2013


Author: emaste
Date: Mon Nov 25 14:33:56 2013
New Revision: 195681

URL: http://llvm.org/viewvc/llvm-project?rev=195681&view=rev
Log:
Correct a standalone debug file path

For a file /bin/ls with a .gnu_debuglink entry of "ls.debug" the path
should be /usr/lib/debug/bin/ls.debug, not /usr/lib/debug/bin/ls.

ref: https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html

llvm.org/pr17903
http://llvm-reviews.chandlerc.com/D2169

Modified:
    lldb/trunk/source/Host/common/Symbols.cpp

Modified: lldb/trunk/source/Host/common/Symbols.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Symbols.cpp?rev=195681&r1=195680&r2=195681&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Symbols.cpp (original)
+++ lldb/trunk/source/Host/common/Symbols.cpp Mon Nov 25 14:33:56 2013
@@ -61,9 +61,9 @@ Symbols::LocateExecutableSymbolFile (con
         uuid_str = uuid_str + ".debug";
     }
 
-    // Get full path to our module. Needed to check debug files like this:
-    //   /usr/lib/debug/usr/lib/libboost_date_time.so.1.46.1
-    std::string module_filename = module_spec.GetFileSpec().GetPath();
+    // Get directory of our module. Needed to check debug files like this:
+    //   /usr/lib/debug/usr/lib/library.so.debug
+    std::string module_directory = module_spec.GetFileSpec().GetDirectory().AsCString();
 
     size_t num_directories = debug_file_search_paths.GetSize();
     for (size_t idx = 0; idx < num_directories; ++idx)
@@ -79,7 +79,7 @@ Symbols::LocateExecutableSymbolFile (con
         files.push_back (dirname + "/" + symbol_filename);
         files.push_back (dirname + "/.debug/" + symbol_filename);
         files.push_back (dirname + "/.build-id/" + uuid_str);
-        files.push_back (dirname + module_filename);
+        files.push_back (dirname + module_directory + "/" + symbol_filename);
 
         const uint32_t num_files = files.size();
         for (size_t idx_file = 0; idx_file < num_files; ++idx_file)





More information about the lldb-commits mailing list