Skip to content

Revert "[LLDB][DWARF] Add an option to silence unsupported DW_FORM warnings" #106765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
#include <cctype>
#include <cstring>

// #define ENABLE_DEBUG_PRINTF // COMMENT OUT THIS LINE PRIOR TO CHECKIN
//#define ENABLE_DEBUG_PRINTF // COMMENT OUT THIS LINE PRIOR TO CHECKIN

#ifdef ENABLE_DEBUG_PRINTF
#include <cstdio>
Expand Down Expand Up @@ -129,11 +129,6 @@ class PluginProperties : public Properties {
bool IgnoreFileIndexes() const {
return GetPropertyAtIndexAs<bool>(ePropertyIgnoreIndexes, false);
}

bool EmitUnsupportedDWFormValueWarning() const {
return GetPropertyAtIndexAs<bool>(
ePropertyEmitUnsupportedDWFormValueWarning, true);
}
};

} // namespace
Expand Down Expand Up @@ -629,14 +624,12 @@ uint32_t SymbolFileDWARF::CalculateAbilities() {
llvm::DWARFDebugAbbrev *abbrev = DebugAbbrev();
std::set<dw_form_t> unsupported_forms = GetUnsupportedForms(abbrev);
if (!unsupported_forms.empty()) {
if (GetGlobalPluginProperties().EmitUnsupportedDWFormValueWarning()) {
StreamString error;
error.Printf("unsupported DW_FORM value%s:",
unsupported_forms.size() > 1 ? "s" : "");
for (auto form : unsupported_forms)
error.Printf(" %#x", form);
m_objfile_sp->GetModule()->ReportWarning("{0}", error.GetString());
}
StreamString error;
error.Printf("unsupported DW_FORM value%s:",
unsupported_forms.size() > 1 ? "s" : "");
for (auto form : unsupported_forms)
error.Printf(" %#x", form);
m_objfile_sp->GetModule()->ReportWarning("{0}", error.GetString());
return 0;
}

Expand Down Expand Up @@ -1777,17 +1770,16 @@ SymbolFileDWARF *SymbolFileDWARF::GetDIERefSymbolFile(const DIERef &die_ref) {
return this;

if (file_index) {
// We have a SymbolFileDWARFDebugMap, so let it find the right file
// We have a SymbolFileDWARFDebugMap, so let it find the right file
if (SymbolFileDWARFDebugMap *debug_map = GetDebugMapSymfile())
return debug_map->GetSymbolFileByOSOIndex(*file_index);

// Handle the .dwp file case correctly
if (*file_index == DIERef::k_file_index_mask)
return GetDwpSymbolFile().get(); // DWP case

// Handle the .dwo file case correctly
return DebugInfo()
.GetUnitAtIndex(*die_ref.file_index())
return DebugInfo().GetUnitAtIndex(*die_ref.file_index())
->GetDwoSymbolFile(); // DWO case
}
return this;
Expand Down Expand Up @@ -3629,7 +3621,7 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
lldb::addr_t location_DW_OP_addr = LLDB_INVALID_ADDRESS;
if (!location_is_const_value_data) {
bool op_error = false;
const DWARFExpression *location = location_list.GetAlwaysValidExpr();
const DWARFExpression* location = location_list.GetAlwaysValidExpr();
if (location)
location_DW_OP_addr =
location->GetLocation_DW_OP_addr(location_form.GetUnit(), op_error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,4 @@ let Definition = "symbolfiledwarf" in {
Global,
DefaultFalse,
Desc<"Ignore indexes present in the object files and always index DWARF manually.">;
def EmitUnsupportedDWFormValueWarning: Property<"emit-unsupported-dwform-value", "Boolean">,
Global,
DefaultTrue,
Desc<"Emit warnings about unsupported DW_Form values.">;
}
Loading