[Lldb-commits] [lldb] [lldb][AIX] Support for XCOFF Sections (PR #131304)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Apr 3 06:00:17 PDT 2025
================
@@ -190,8 +190,83 @@ void ObjectFileXCOFF::ParseSymtab(Symtab &lldb_symtab) {}
bool ObjectFileXCOFF::IsStripped() { return false; }
-void ObjectFileXCOFF::CreateSections(SectionList &unified_section_list) {}
-
+void ObjectFileXCOFF::CreateSections(SectionList &unified_section_list) {
+
+ if (m_sections_up)
+ return;
+ m_sections_up = std::make_unique<SectionList>();
+ ModuleSP module_sp(GetModule());
+ if (module_sp) {
+ std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
+
+ ModuleSP module_sp(GetModule());
+ for (auto sIdx = m_binary->section_begin(); sIdx != m_binary->section_end();
+ ++sIdx) {
+ llvm::Expected<llvm::StringRef> name =
+ m_binary->getSectionName(sIdx->getRawDataRefImpl());
+ if (!name) {
+ llvm::Error err = name.takeError();
+ }
----------------
labath wrote:
This isn't the right way to handle an error. llvm::Errors must be checked, according to https://llvm.org/docs/ProgrammersManual.html#recoverable-errors
At this point, the best way to "handle" the errors is probably to log them, with something like this:
```suggestion
if (!name)
LLDB_LOG_ERROR(log, name.takeError(), "Some text: {0}");
```
https://github.com/llvm/llvm-project/pull/131304
More information about the lldb-commits
mailing list