[Lldb-commits] [PATCH] D45628: [LLDB] Support compressed debug info sections (.zdebug*)

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 13 10:36:53 PDT 2018


clayborg added inline comments.


================
Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2937-2938
 {
   static const char *debug_prefix = ".debug";
+  static const char *zdebug_prefix = ".zdebug";
 
----------------
Might be worth making these llvm::StringRef, then see comments below..


================
Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2948
 
   const char *section_name = section->GetName().GetCString();
   // Can't relocate that which can't be named
----------------
Make this a StringRef:

```
llvm::StringRef section_name = section->GetName().GetStringRef();
```


================
Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2954-2955
   // We don't relocate non-debug sections at the moment
-  if (strncmp(section_name, debug_prefix, strlen(debug_prefix)))
+  if (strncmp(section_name, debug_prefix, strlen(debug_prefix)) ||
+      strncmp(section_name, zdebug_prefix, strlen(zdebug_prefix)))
     return;
----------------
use StringRef::startswith:

```
if (section_name.startswith(debug_prefix) || section_name.startswith(zdebug_prefix))
```


================
Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:3451
+  if (!llvm::object::Decompressor::isCompressedELFSection(
+          section->Get(), section->GetName().GetStringRef()))
     return ObjectFile::ReadSectionData(section, section_offset, dst, dst_len);
----------------
use "section_name" here instead of "section->GetName().GetStringRef()" since we switched it to a StringRef


================
Comment at: source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:3472
+                         section->Get(), section->GetName().GetStringRef()))
     return result;
 
----------------
Ditto


https://reviews.llvm.org/D45628





More information about the lldb-commits mailing list