Add form used for SPECIAL_expr as comment in testsuite Dwarf Assembler
authorMark Wielaard <mark@klomp.org>
Mon, 14 Dec 2020 19:00:50 +0000 (20:00 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 14 Dec 2020 21:06:30 +0000 (22:06 +0100)
Replace the "SPECIAL_expr" comment with either "DW_FORM_block" or
"DW_FORM_exprloc" in the abbrev.

gdb/testsuite/ChangeLog:

* lib/dwarf.exp (Dwarf::_handle_attribute): Handle SPECIAL_expr
specially, set attr_form_comment to the actual FORM string used.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/dwarf.exp

index ab03f0745dabf9c7744d327e8e93a9d1f5c4c682..8206b3e35cc6a08547342e5f5b451cb559a7a7b9 100644 (file)
@@ -1,3 +1,8 @@
+2020-12-14  Mark Wielaard  <mark@klomp.org>
+
+       * 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  <mark@klomp.org>
 
        * lib/dwarf.exp (Dwarf::_read_constants): Don't set
index 43ae29697cdf1bce2343d0100dffe33871a2e2d7..5afb3e3e736a2217191ba399f551ff202718c8e3 100644 (file)
@@ -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
        }
     }