From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17417 invoked by alias); 10 Jan 2014 11:29:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 17404 invoked by uid 89); 10 Jan 2014 11:29:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Jan 2014 11:29:05 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0ABT0vL019701 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 10 Jan 2014 06:29:00 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s0ABSwIF003103; Fri, 10 Jan 2014 06:28:59 -0500 Message-ID: <52CFD97A.4040009@redhat.com> Date: Fri, 10 Jan 2014 11:29:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andreas Arnez CC: gdb-patches@sourceware.org, Ulrich Weigand , Andreas Krebbel Subject: Re: [PATCH] Fix possible alignment issue with dw2-dir-file-name test case References: <87a9f65p73.fsf@br87z6lw.de.ibm.com> In-Reply-To: <87a9f65p73.fsf@br87z6lw.de.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00275.txt.bz2 On 01/08/2014 06:00 PM, Andreas Arnez wrote: > Since upstream gcc has recently increased the function alignment on > S390, the dw2-dir-file-name test case fails in the first > gdb_continue_to_breakpoint. Indeed, the breakpoint is now placed into > the alignment gap *before* the actual function. > > This happens because the test case declares the respective "*_start" > symbol as a "loose" label before the function definition, and the > compiler inserts the alignment between that label and the function > itself. The fix defines the "*_start" symbol as a global alias to the > function instead. It seems the _start symbol only needs to exist because the functions were declared static: > -#define FUNC(name) \ > - asm (#name "_start: .globl " #name "_start\n"); \ > - static void \ > - name (void) \ But I see nothing that needs them to be static. This seems simpler to me: --- gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c | 3 +-- gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c index 21a4d2a..2b9cc6a 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c @@ -64,8 +64,7 @@ FUNC (compdir_absolute_ldir_absolute_file_absolute_same) \ FUNC (compdir_absolute_ldir_absolute_file_absolute_different) #define FUNC(name) \ - asm (#name "_start: .globl " #name "_start\n"); \ - static void \ + void \ name (void) \ { \ v++; \ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp index 7f29581..e523e89 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp @@ -54,7 +54,7 @@ proc out_cu { name cu_dir cu_name line_dir line_name } { .ascii \"GNU C\\0\" /* DW_AT_producer */ .byte 2 /* DW_AT_language (DW_LANG_C) */ .4byte .Lline_${name}_begin /* DW_AT_stmt_list */ - .4byte ${name}_start /* DW_AT_low_pc */ + .4byte ${name} /* DW_AT_low_pc */ .4byte ${name}_end /* DW_AT_high_pc */ " if { $cu_dir != "" } { @@ -65,7 +65,7 @@ proc out_cu { name cu_dir cu_name line_dir line_name } { .uleb128 3 /* Abbrev: DW_TAG_subprogram */ .asciz \"${name}\" /* DW_AT_name */ - .4byte ${name}_start /* DW_AT_low_pc */ + .4byte ${name} /* DW_AT_low_pc */ .4byte ${name}_end /* DW_AT_high_pc */ .byte 0 /* End of children of CU */ @@ -122,7 +122,7 @@ proc out_line { name cu_dir cu_name line_dir line_name } { .byte 0 /* DW_LNE_set_address */ .uleb128 5 .byte 2 - .4byte ${name}_start + .4byte ${name} .byte 1 /* DW_LNS_copy */ .byte 3 /* DW_LNS_advance_line */ .sleb128 1 /* ... to 1000 */ -- 1.7.11.7