public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Start abbrevs at 1 in DWARF assembler
@ 2023-12-06 16:26 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2023-12-06 16:26 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d8ad643f4ef7fa77425e58f157fe3f2917ef46b4

commit d8ad643f4ef7fa77425e58f157fe3f2917ef46b4
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Dec 6 17:26:33 2023 +0100

    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>

Diff:
---
 gdb/testsuite/lib/dwarf.exp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp
index f09da0430ab..a9b5be859a8 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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-12-06 16:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06 16:26 [binutils-gdb] Start abbrevs at 1 in DWARF assembler Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).