sas created this revision.
Herald added subscribers: JDevlieghere, emaste.

In ObjectFileELF we try to read the `.gnu_debuglink` section of the ELF
file to determine the name of the debug symbols file. If this section
does not exist, we stop the search. Instead, what we should do is locate
a file with the same name as the ELF binary, which is the default
behavior when there isn't any `.gnu_debuglink` section present.

Ran check-lldb to make sure this doesn't break anything.


https://reviews.llvm.org/D40539

Files:
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===================================================================
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1000,7 +1000,11 @@
   if (!m_gnu_debuglink_file.empty()) {
     FileSpec file_spec(m_gnu_debuglink_file, false);
     file_spec_list.Append(file_spec);
+  } else {
+    FileSpec file_spec(GetFileSpec().GetFilename().AsCString(), false);
+    file_spec_list.Append(file_spec);
   }
+
   return file_spec_list;
 }
 


Index: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
===================================================================
--- source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1000,7 +1000,11 @@
   if (!m_gnu_debuglink_file.empty()) {
     FileSpec file_spec(m_gnu_debuglink_file, false);
     file_spec_list.Append(file_spec);
+  } else {
+    FileSpec file_spec(GetFileSpec().GetFilename().AsCString(), false);
+    file_spec_list.Append(file_spec);
   }
+
   return file_spec_list;
 }
 
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to