From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23188 invoked by alias); 22 Apr 2003 20:13:52 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 23181 invoked from network); 22 Apr 2003 20:13:51 -0000 Received: from unknown (HELO ns2.uk.superh.com) (193.128.105.170) by sources.redhat.com with SMTP; 22 Apr 2003 20:13:51 -0000 Received: from sh-uk-ex01.uk.w2k.superh.com (sh-uk-ex01 [192.168.16.17]) by ns2.uk.superh.com (8.11.6+Sun/8.11.6) with ESMTP id h3MJr1x27276; Tue, 22 Apr 2003 20:53:02 +0100 (BST) Received: from superh.com ([192.168.17.40]) by sh-uk-ex01.uk.w2k.superh.com with Microsoft SMTPSVC(5.0.2195.5329); Tue, 22 Apr 2003 21:14:03 +0100 Message-ID: <3EA5A211.14A57085@superh.com> Date: Tue, 22 Apr 2003 20:13:00 -0000 From: Joern Rennecke Organization: SuperH UK Ltd. X-Accept-Language: en MIME-Version: 1.0 To: binutils@sources.redhat.com CC: Alexandre Oliva , Alan Modra , Nick Clifton Subject: RFA: Fix readelf -wi test (Was: Re: readelf: apply all rela relocations in the debug_info section) References: <3EA58964.E0269B6F@superh.com> <3EA58B57.F6F58A01@superh.com> Content-Type: multipart/mixed; boundary="------------1BC15B12B290BB0B2D88FE31" X-OriginalArrivalTime: 22 Apr 2003 20:14:03.0015 (UTC) FILETIME=[B7D78170:01C3090B] X-SW-Source: 2003-04/txt/msg00420.txt.bz2 This is a multi-part message in MIME format. --------------1BC15B12B290BB0B2D88FE31 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-length: 118 -- -------------------------- SuperH (UK) Ltd. 2410 Aztec West / Almondsbury / BRISTOL / BS32 4QX T:+44 1454 465658 --------------1BC15B12B290BB0B2D88FE31 Content-Type: text/plain; charset=us-ascii; name="readelf-diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="readelf-diff" Content-length: 9201 Alexandre's patch did not only cause warnings, it also corrupted most or all of the strings. The reaadelf.wi template hasn't been updated in years, and not only the representation of the debug information, even the source file numbers are out of date; that mean that any sucess on this testcase (not counting XFAILs) on any target must have been a bug. I've updated readelf.wi so that the test passes for sh-elf; the readelf.out for sh-elf is attached separately. The output style change that I have considered a bug is the adding of a trailing "; " in every location expression, e.g. (DW_OP_addr: 0) . The following patch implements this readelf.wi update and suppression of the trailing "; ". If someone knows what the right dejagnu incantation is, it would be nice to invoke gcc either with -fsigned-char or -funsigned-char when generating testprog.o, so that we get a reproducible type for string. Or should we change the source file testprog.c ? 2003-04-22 J"orn Rennecke binutils: * readelf.c (decode_location_expression): Don't add a trailing "; " . binutils/testsuite: * readelf.wi: Update. Index: readelf.c =================================================================== RCS file: /cvs/src/src/binutils/readelf.c,v retrieving revision 1.202 diff -p -r1.202 readelf.c *** readelf.c 22 Apr 2003 16:22:26 -0000 1.202 --- readelf.c 22 Apr 2003 19:55:38 -0000 *************** decode_location_expression (data, pointe *** 7727,7733 **** } /* Separate the ops. */ ! printf ("; "); } } --- 7655,7662 ---- } /* Separate the ops. */ ! if (data < end) ! printf ("; "); } } Index: testsuite/binutils-all/readelf.wi =================================================================== RCS file: /cvs/src/src/binutils/testsuite/binutils-all/readelf.wi,v retrieving revision 1.4 diff -p -r1.4 readelf.wi *** testsuite/binutils-all/readelf.wi 18 Feb 2001 23:32:59 -0000 1.4 --- testsuite/binutils-all/readelf.wi 22 Apr 2003 19:55:38 -0000 *************** The section .debug_info contains: *** 6,76 **** Abbrev Offset: 0 Pointer Size: 4 <.><.*>: Abbrev Number: .* \(DW_TAG_compile_unit\) ! DW_AT_name : .*/testprog.c ! DW_AT_comp_dir : .*/binutils ! DW_AT_producer : GNU C .* ! DW_AT_language : 1 \(ANSI C\) ! DW_AT_low_pc : 0 ! DW_AT_high_pc : .* DW_AT_stmt_list : 0 - <.><.*>: Abbrev Number: 2 \(DW_TAG_subprogram\) - DW_AT_external : 1 - DW_AT_name : fn - DW_AT_decl_file : 1 - DW_AT_decl_line : 10 - DW_AT_type : .* - DW_AT_low_pc : 0 DW_AT_high_pc : .* ! DW_AT_frame_base : 1 byte block: .* <.><.*>: Abbrev Number: 3 \(DW_TAG_base_type\) DW_AT_name : int DW_AT_byte_size : 4 DW_AT_encoding : 5 \(signed\) <.><.*>: Abbrev Number: 4 \(DW_TAG_subprogram\) - DW_AT_sibling : .* DW_AT_external : 1 ! DW_AT_name : main DW_AT_decl_file : 1 ! DW_AT_decl_line : 16 DW_AT_type : .* ! DW_AT_low_pc : .* DW_AT_high_pc : .* DW_AT_frame_base : 1 byte block: .* ! <.><.*>: Abbrev Number: 5 \(DW_TAG_lexical_block\) DW_AT_low_pc : .* DW_AT_high_pc : .* <.><.*>: Abbrev Number: 6 \(DW_TAG_variable\) ! DW_AT_name : common DW_AT_decl_file : 1 ! DW_AT_decl_line : 3 DW_AT_type : <.*> DW_AT_external : 1 DW_AT_location : 5 byte block: 3 0 0 0 0 \(DW_OP_addr: 0\) <.><.*>: Abbrev Number: 6 \(DW_TAG_variable\) ! DW_AT_name : global DW_AT_decl_file : 1 ! DW_AT_decl_line : 4 DW_AT_type : <.*> DW_AT_external : 1 DW_AT_location : 5 byte block: 3 0 0 0 0 \(DW_OP_addr: 0\) <.><.*>: Abbrev Number: 7 \(DW_TAG_variable\) ! DW_AT_name : local DW_AT_decl_file : 1 ! DW_AT_decl_line : 5 DW_AT_type : <.*> DW_AT_location : 5 byte block: 3 . 0 0 . \(DW_OP_addr: .\) <.><.*>: Abbrev Number: 8 \(DW_TAG_array_type\) DW_AT_sibling : <.*> DW_AT_type : <.*> <.><.*>: Abbrev Number: 9 \(DW_TAG_subrange_type\) DW_AT_upper_bound : 6 - <.><.*>: Abbrev Number: 3 \(DW_TAG_base_type\) - DW_AT_name : char - DW_AT_byte_size : 1 - DW_AT_encoding : 8 \(unsigned char\) <.><.*>: Abbrev Number: 7 \(DW_TAG_variable\) ! DW_AT_name : string DW_AT_decl_file : 1 ! DW_AT_decl_line : 6 DW_AT_type : <.*> DW_AT_location : 5 byte block: 3 . 0 0 . \(DW_OP_addr: .\) --- 6,109 ---- Abbrev Offset: 0 Pointer Size: 4 <.><.*>: Abbrev Number: .* \(DW_TAG_compile_unit\) ! # DW_AT_comp_dir : .*/binutils DW_AT_stmt_list : 0 DW_AT_high_pc : .* ! DW_AT_low_pc : 0.* ! DW_AT_producer .*: GNU C .* ! DW_AT_language : 1 \(ANSI C\) ! DW_AT_name : .*/testprog.c ! <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) ! DW_AT_name : \(indirect string, offset: 0x.*\): unsigned int ! DW_AT_byte_size : 4 ! DW_AT_encoding : 7 \(unsigned\) ! <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) ! DW_AT_name : \(indirect string, offset: 0x.*\): long int ! DW_AT_byte_size : 4 ! DW_AT_encoding : 5 \(signed\) ! <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) ! DW_AT_name : \(indirect string, offset: 0x.*\): long long int ! DW_AT_byte_size : 8 ! DW_AT_encoding : 5 \(signed\) <.><.*>: Abbrev Number: 3 \(DW_TAG_base_type\) DW_AT_name : int DW_AT_byte_size : 4 DW_AT_encoding : 5 \(signed\) + <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) + DW_AT_name : \(indirect string, offset: 0x.*\): unsigned int + DW_AT_byte_size : 4 + DW_AT_encoding : 7 \(unsigned\) + <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) + DW_AT_name : \(indirect string, offset: 0x.*\): unsigned char + DW_AT_byte_size : 1 + DW_AT_encoding : 8 \(unsigned char\) + <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) + DW_AT_name : \(indirect string, offset: 0x.*\): long unsigned int + DW_AT_byte_size : 4 + DW_AT_encoding : 7 \(unsigned\) + <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) + DW_AT_name : \(indirect string, offset: 0x.*\): short int + DW_AT_byte_size : 2 + DW_AT_encoding : 5 \(signed\) + <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) + DW_AT_name : \(indirect string, offset: 0x.*\): char + DW_AT_byte_size : 1 + DW_AT_encoding : 6 \(signed char\) + <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) + DW_AT_name : \(indirect string, offset: 0x4c\): short unsigned int + DW_AT_byte_size : 2 + DW_AT_encoding : 7 \(unsigned\) + <.><.*>: Abbrev Number: 2 \(DW_TAG_base_type\) + DW_AT_name : \(indirect string, offset: 0x.*\): long long unsigned int + DW_AT_byte_size : 8 + DW_AT_encoding : 7 \(unsigned\) <.><.*>: Abbrev Number: 4 \(DW_TAG_subprogram\) DW_AT_external : 1 ! DW_AT_name : fn DW_AT_decl_file : 1 ! DW_AT_decl_line : 13 DW_AT_type : .* ! DW_AT_low_pc : 0.* DW_AT_high_pc : .* DW_AT_frame_base : 1 byte block: .* ! <.><.*>: Abbrev Number: 5 \(DW_TAG_subprogram\) ! DW_AT_external : 1 ! DW_AT_name .*: main ! DW_AT_decl_file : 1 ! DW_AT_decl_line : 19 ! DW_AT_type : .* DW_AT_low_pc : .* DW_AT_high_pc : .* + DW_AT_frame_base : 1 byte block: .* <.><.*>: Abbrev Number: 6 \(DW_TAG_variable\) ! DW_AT_name .*: common DW_AT_decl_file : 1 ! DW_AT_decl_line : 6 DW_AT_type : <.*> DW_AT_external : 1 DW_AT_location : 5 byte block: 3 0 0 0 0 \(DW_OP_addr: 0\) <.><.*>: Abbrev Number: 6 \(DW_TAG_variable\) ! DW_AT_name .*: global DW_AT_decl_file : 1 ! DW_AT_decl_line : 7 DW_AT_type : <.*> DW_AT_external : 1 DW_AT_location : 5 byte block: 3 0 0 0 0 \(DW_OP_addr: 0\) <.><.*>: Abbrev Number: 7 \(DW_TAG_variable\) ! DW_AT_name .*: local DW_AT_decl_file : 1 ! DW_AT_decl_line : 8 DW_AT_type : <.*> DW_AT_location : 5 byte block: 3 . 0 0 . \(DW_OP_addr: .\) <.><.*>: Abbrev Number: 8 \(DW_TAG_array_type\) DW_AT_sibling : <.*> DW_AT_type : <.*> <.><.*>: Abbrev Number: 9 \(DW_TAG_subrange_type\) + DW_AT_type : <.*> DW_AT_upper_bound : 6 <.><.*>: Abbrev Number: 7 \(DW_TAG_variable\) ! DW_AT_name .*: string DW_AT_decl_file : 1 ! DW_AT_decl_line : 9 DW_AT_type : <.*> DW_AT_location : 5 byte block: 3 . 0 0 . \(DW_OP_addr: .\) --------------1BC15B12B290BB0B2D88FE31 Content-Type: text/plain; charset=us-ascii; name="readelf.out" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="readelf.out" Content-length: 4520 The section .debug_info contains: Compilation Unit @ 0: Length: 236 Version: 2 Abbrev Offset: 0 Pointer Size: 4 <0>: Abbrev Number: 1 (DW_TAG_compile_unit) DW_AT_stmt_list : 0 DW_AT_high_pc : 0x98 152 DW_AT_low_pc : 0 0 DW_AT_producer : (indirect string, offset: 0xc2): GNU C 3.4 20030303 (experimental) DW_AT_language : 1 (ANSI C) DW_AT_name : (indirect string, offset: 0x74): /swbuild/build/main/srcw/binutils/testsuite/binutils-all/testprog.c <1><21>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0xe9): unsigned int DW_AT_byte_size : 4 DW_AT_encoding : 7 (unsigned) <1><28>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0x2c): long int DW_AT_byte_size : 4 DW_AT_encoding : 5 (signed) <1><2f>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0x1e): long long int DW_AT_byte_size : 8 DW_AT_encoding : 5 (signed) <1><36>: Abbrev Number: 3 (DW_TAG_base_type) DW_AT_name : int DW_AT_byte_size : 4 DW_AT_encoding : 5 (signed) <1><3d>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0xe9): unsigned int DW_AT_byte_size : 4 DW_AT_encoding : 7 (unsigned) <1><44>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0x66): unsigned char DW_AT_byte_size : 1 DW_AT_encoding : 8 (unsigned char) <1><4b>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0x3a): long unsigned int DW_AT_byte_size : 4 DW_AT_encoding : 7 (unsigned) <1><52>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0xb8): short int DW_AT_byte_size : 2 DW_AT_encoding : 5 (signed) <1><59>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0xe4): char DW_AT_byte_size : 1 DW_AT_encoding : 6 (signed char) <1><60>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0x4c): short unsigned int DW_AT_byte_size : 2 DW_AT_encoding : 7 (unsigned) <1><67>: Abbrev Number: 2 (DW_TAG_base_type) DW_AT_name : (indirect string, offset: 0x7): long long unsigned int DW_AT_byte_size : 8 DW_AT_encoding : 7 (unsigned) <1><6e>: Abbrev Number: 4 (DW_TAG_subprogram) DW_AT_external : 1 DW_AT_name : fn DW_AT_decl_file : 1 DW_AT_decl_line : 13 DW_AT_type : <36> DW_AT_low_pc : 0 0 DW_AT_high_pc : 0xe 14 DW_AT_frame_base : 1 byte block: 5e (DW_OP_reg14) <1><83>: Abbrev Number: 5 (DW_TAG_subprogram) DW_AT_external : 1 DW_AT_name : (indirect string, offset: 0x35): main DW_AT_decl_file : 1 DW_AT_decl_line : 19 DW_AT_type : <36> DW_AT_low_pc : 0xe 14 DW_AT_high_pc : 0x98 152 DW_AT_frame_base : 1 byte block: 5e (DW_OP_reg14) <1><99>: Abbrev Number: 6 (DW_TAG_variable) DW_AT_name : (indirect string, offset: 0x5f): common DW_AT_decl_file : 1 DW_AT_decl_line : 6 DW_AT_type : <36> DW_AT_external : 1 DW_AT_location : 5 byte block: 3 0 0 0 0 (DW_OP_addr: 0) <1>: Abbrev Number: 6 (DW_TAG_variable) DW_AT_name : (indirect string, offset: 0xf6): global DW_AT_decl_file : 1 DW_AT_decl_line : 7 DW_AT_type : <36> DW_AT_external : 1 DW_AT_location : 5 byte block: 3 0 0 0 0 (DW_OP_addr: 0) <1>: Abbrev Number: 7 (DW_TAG_variable) DW_AT_name : (indirect string, offset: 0xfd): local DW_AT_decl_file : 1 DW_AT_decl_line : 8 DW_AT_type : <36> DW_AT_location : 5 byte block: 3 0 0 0 4 (DW_OP_addr: 4) <1>: Abbrev Number: 8 (DW_TAG_array_type) DW_AT_sibling : DW_AT_type : <59> <2>: Abbrev Number: 9 (DW_TAG_subrange_type) DW_AT_type : <3d> DW_AT_upper_bound : 6 <1>: Abbrev Number: 7 (DW_TAG_variable) DW_AT_name : (indirect string, offset: 0x0): string DW_AT_decl_file : 1 DW_AT_decl_line : 9 DW_AT_type : DW_AT_location : 5 byte block: 3 0 0 0 8 (DW_OP_addr: 8) --------------1BC15B12B290BB0B2D88FE31--