diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index ab03f0745d..8206b3e35c 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-12-14 Mark Wielaard + + * lib/dwarf.exp (Dwarf::_handle_attribute): Handle SPECIAL_expr + specially, set attr_form_comment to the actual FORM string used. + 2020-12-14 Mark Wielaard * lib/dwarf.exp (Dwarf::_read_constants): Don't set diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 43ae29697c..5afb3e3e73 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -622,12 +622,22 @@ namespace eval Dwarf { proc _handle_attribute { attr_name attr_value attr_form } { variable _abbrev_section variable _constants + variable _cu_version _handle_DW_FORM $attr_form $attr_value _defer_output $_abbrev_section { + if { $attr_form eq "SPECIAL_expr" } { + if { $_cu_version < 4 } { + set attr_form_comment "DW_FORM_block" + } else { + set attr_form_comment "DW_FORM_exprloc" + } + } else { + set attr_form_comment $attr_form + } _op .uleb128 $_constants($attr_name) $attr_name - _op .uleb128 $_constants($attr_form) $attr_form + _op .uleb128 $_constants($attr_form) $attr_form_comment } }