aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-12-14 20:00:50 +0100
committerMark Wielaard <mark@klomp.org>2020-12-14 22:06:30 +0100
commit8cd6d968de17f5dac1601d7cbdda838c9d82c822 (patch)
treebd39ce171f28c4a179d98b1b7c8c42f7f02daf22
parenteab9267c330046846aa15217da7dcb77f4588220 (diff)
downloadgdb-8cd6d968de17f5dac1601d7cbdda838c9d82c822.zip
gdb-8cd6d968de17f5dac1601d7cbdda838c9d82c822.tar.gz
gdb-8cd6d968de17f5dac1601d7cbdda838c9d82c822.tar.bz2
Add form used for SPECIAL_expr as comment in testsuite Dwarf Assembler
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.
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/lib/dwarf.exp12
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index ab03f07..8206b3e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
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
_constants(SPECIAL_expr) here, but set it...
(Dwarf::cu): ...here based on _cu_version.
diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index 43ae296..5afb3e3 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
}
}