From patchwork Thu Oct 3 13:03:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 34816 Received: (qmail 81439 invoked by alias); 3 Oct 2019 13:03:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 81430 invoked by uid 89); 3 Oct 2019 13:03:46 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, SPF_PASS autolearn=ham version=3.3.1 spammy=4.8, 4.8.5 X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Oct 2019 13:03:45 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 397B8B17A for ; Thu, 3 Oct 2019 13:03:43 +0000 (UTC) Date: Thu, 3 Oct 2019 15:03:41 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix info-types.exp with gcc/g++ 4.8 Message-ID: <20191003130340.GA5980@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes Hi, The gdb.base/info-types.exp test-case FAILs with gcc/g++ 4.8 because the DWARF record for the 'unsigned int' type is missing in the executables, while it is present for gcc/g++ 7.4.1. For a minimal example using gcc 7.4.1: ... $ echo "enum enum_t { AA, BB, CC }; enum enum_t var;" > enum.c $ gcc enum.c -c -g ... we find that the enum type has DW_AT_encoding 'unsigned': <1><1d>: Abbrev Number: 2 (DW_TAG_enumeration_type) <1e> DW_AT_name : (indirect string, offset: 0x1f): enum_t <22> DW_AT_encoding : 7 (unsigned) <23> DW_AT_byte_size : 4 <24> DW_AT_type : <0x3e> <28> DW_AT_decl_file : 1 <29> DW_AT_decl_line : 1 <2a> DW_AT_sibling : <0x3e> ... and a DW_AT_type reference to the type 'unsigned int': ... <1><3e>: Abbrev Number: 4 (DW_TAG_base_type) <3f> DW_AT_byte_size : 4 <40> DW_AT_encoding : 7 (unsigned) <41> DW_AT_name : (indirect string, offset: 0x26): unsigned int ... With gcc 4.8.5 however, we have no 'unsigned' encoding, and no DW_AT_type: ... <1><1d>: Abbrev Number: 2 (DW_TAG_enumeration_type) <1e> DW_AT_name : (indirect string, offset: 0x1f): enum_t <22> DW_AT_byte_size : 4 <23> DW_AT_decl_file : 1 <24> DW_AT_decl_line : 1 <25> DW_AT_sibling : <0x39> ... as well as no record for 'unsigned int'. Make the test-case pass with gcc/g++ 4.8 by making the presence of the 'unsigned int' type optional. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix info-types.exp with gcc/g++ 4.8 gdb/testsuite/ChangeLog: 2019-10-03 Tom de Vries PR testsuite/25059 * gdb.base/info-types.exp: Make the presence of the 'unsigned int' type optional. --- gdb/testsuite/gdb.base/info-types.exp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.base/info-types.exp b/gdb/testsuite/gdb.base/info-types.exp index fd190ae58f4..8c1ddac2c6b 100644 --- a/gdb/testsuite/gdb.base/info-types.exp +++ b/gdb/testsuite/gdb.base/info-types.exp @@ -85,8 +85,8 @@ proc run_test { lang } { "39:\[\t \]+typedef enum_t nested_enum_t;" \ "19:\[\t \]+typedef float nested_float_t;" \ "18:\[\t \]+typedef int nested_int_t;" \ - "62:\[\t \]+typedef union_t nested_union_t;" \ - "\[\t \]+unsigned int(" \ + "62:\[\t \]+typedef union_t nested_union_t;(" \ + "\[\t \]+unsigned int)?(" \ "" \ "File .*:.*)?" ] } else { @@ -117,8 +117,8 @@ proc run_test { lang } { "19:\[\t \]+typedef float nested_float_t;" \ "18:\[\t \]+typedef int nested_int_t;" \ "62:\[\t \]+typedef union union_t nested_union_t;" \ - "56:\[\t \]+union union_t;" \ - "\[\t \]+unsigned int(" \ + "56:\[\t \]+union union_t;(" \ + "\[\t \]+unsigned int)?(" \ "" \ "File .*:.*)?" ] }