From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id i2JEME6IoV9kNwAAWB0awg (envelope-from ) for ; Tue, 03 Nov 2020 11:41:50 -0500 Received: by simark.ca (Postfix, from userid 112) id BD1901E58D; Tue, 3 Nov 2020 11:41:50 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id DB7491E58D for ; Tue, 3 Nov 2020 11:41:49 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6C70F3986834; Tue, 3 Nov 2020 16:41:49 +0000 (GMT) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTP id 5A7443854806 for ; Tue, 3 Nov 2020 16:41:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5A7443854806 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D78DFB2E4 for ; Tue, 3 Nov 2020 16:41:46 +0000 (UTC) Date: Tue, 3 Nov 2020 17:41:45 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix .debug_abbrev terminators Message-ID: <20201103164143.GA10785@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Hi, The abbreviations table for a single compilation unit has two types of terminators: - a ".byte 0" pair denoting the end of an attribute list - a single ".byte 0" denoting the end of the table However, at the end of the .debug_abbrev section in dw2-line-number-zero-dw.S, we have four ".byte 0" entries: ... .uleb128 0x12 /* DW_AT_high_pc */ .uleb128 0x01 /* DW_FORM_addr */ .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ ... The first two are the attribute list terminator, the third is the end-of-table terminator, and the last is superfluous/incorrect. Fix this by emitting instead: ... .uleb128 0x12 /* DW_AT_high_pc */ .uleb128 0x01 /* DW_FORM_addr */ .byte 0x0 /* DW_AT - Terminator */ .byte 0x0 /* DW_FORM - Terminator */ .byte 0x0 /* Abbrev end - Terminator */ ... where the last comment resembles the comment for other abbreviation codes: ... .section .debug_abbrev .Labbrev1_begin: .uleb128 2 /* Abbrev start */ ... Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix .debug_abbrev terminators gdb/testsuite/ChangeLog: 2020-11-03 Tom de Vries * lib/dwarf.exp (Dwarf::_handle_DW_TAG): Improve attribute list terminator comments. (Dwarf::cu, Dwarf::tu): Remove superfluous abbreviation table terminator. --- gdb/testsuite/lib/dwarf.exp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/lib/dwarf.exp b/gdb/testsuite/lib/dwarf.exp index 1a0cbf689e..c585621ac4 100644 --- a/gdb/testsuite/lib/dwarf.exp +++ b/gdb/testsuite/lib/dwarf.exp @@ -723,8 +723,8 @@ namespace eval Dwarf { _defer_output $_abbrev_section { # Terminator. - _op .byte 0x0 Terminator - _op .byte 0x0 Terminator + _op .byte 0x0 "DW_AT - Terminator" + _op .byte 0x0 "DW_FORM - Terminator" } if {$has_children} { @@ -1111,8 +1111,7 @@ namespace eval Dwarf { _defer_output $_abbrev_section { # Emit the terminator. - _op .byte 0x0 Terminator - _op .byte 0x0 Terminator + _op .byte 0x0 "Abbrev end - Terminator" } define_label $end_label @@ -1220,8 +1219,7 @@ namespace eval Dwarf { _defer_output $_abbrev_section { # Emit the terminator. - _op .byte 0x0 Terminator - _op .byte 0x0 Terminator + _op .byte 0x0 "Abbrev end - Terminator" } define_label $end_label