aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-12-06 17:26:33 +0100
committerTom de Vries <tdevries@suse.de>2023-12-06 17:26:33 +0100
commitd8ad643f4ef7fa77425e58f157fe3f2917ef46b4 (patch)
tree3de31cf94fc9406a8c1641cf4fa0c7ffa9122b63 /gdb/testsuite
parent288363c1737f93e2f7cb8c06026c11a5ff77fb58 (diff)
downloadgdb-d8ad643f4ef7fa77425e58f157fe3f2917ef46b4.zip
gdb-d8ad643f4ef7fa77425e58f157fe3f2917ef46b4.tar.gz
gdb-d8ad643f4ef7fa77425e58f157fe3f2917ef46b4.tar.bz2
Start abbrevs at 1 in DWARF assembler
I noticed that the DWARF assembler starts abbrevs at 2. I think 1 should be preferred. Co-Authored-By: Tom de Vries <tdevries@suse.de>
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/lib/dwarf.exp11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index f09da04..a9b5be8 100644
--- a/gdb/testsuite/lib/dwarf.exp
+++ b/gdb/testsuite/lib/dwarf.exp
@@ -958,13 +958,22 @@ namespace eval Dwarf {
_handle_macro_at_range $attr_value
}
+ # Return the next available abbrev number in the current CU's abbrev
+ # table.
+ proc _get_abbrev_num {} {
+ variable _abbrev_num
+ set res $_abbrev_num
+ incr _abbrev_num
+ return $res
+ }
+
proc _handle_DW_TAG {tag_name {attrs {}} {children {}}} {
variable _abbrev_section
variable _abbrev_num
variable _constants
set has_children [expr {[string length $children] > 0}]
- set my_abbrev [incr _abbrev_num]
+ set my_abbrev [_get_abbrev_num]
# We somewhat wastefully emit a new abbrev entry for each tag.
# There's no reason for this other than laziness.