clayborg added inline comments.

================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFContext.cpp:24
+  // forward.
+  extractor.emplace();
+
----------------
clayborg wrote:
> Don't we want to put an empty DWARFDataExtractor in here? Maybe this code 
> should be:
> 
> ```
> const SectionList *section_list = module.GetSectionList();
>   if (!section_list)
>     return nullptr;
> 
>   auto section_sp = section_list->FindSectionByType(section_type, true);
>   if (!section_sp)
>     return nullptr;
> 
>   extractor.emplace();
>   if (section_sp->GetSectionData(*extractor) == 0)
>     extractor = llvm::None;
>   return extractor.getPointer();
> ```
Or use a local DWARFDataExtractor and move it into "extractor" if we succeed?

```
DWARFDataExtractor data;
if (section_sp->GetSectionData(data) > 0)
    extractor = std::move(data);
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59562/new/

https://reviews.llvm.org/D59562



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to