From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13874 invoked by alias); 17 Jan 2014 17:58:38 -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 13864 invoked by uid 89); 17 Jan 2014 17:58:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp12.uk.ibm.com Received: from e06smtp12.uk.ibm.com (HELO e06smtp12.uk.ibm.com) (195.75.94.108) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 17 Jan 2014 17:58:36 +0000 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Jan 2014 17:58:33 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 17 Jan 2014 17:58:30 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 56047219005E for ; Fri, 17 Jan 2014 17:58:28 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s0HHwHhj63701014 for ; Fri, 17 Jan 2014 17:58:17 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s0HHwSNR029543 for ; Fri, 17 Jan 2014 12:58:29 -0500 Received: from br87z6lw.de.ibm.com (dyn-9-152-212-219.boeblingen.de.ibm.com [9.152.212.219]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s0HHwS74029522; Fri, 17 Jan 2014 12:58:28 -0500 From: Andreas Arnez To: Pedro Alves Cc: Edjunior Barbosa Machado , Jan Kratochvil , 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> <52CFD97A.4040009@redhat.com> <87mwj352p5.fsf@br87z6lw.de.ibm.com> <20140110145327.GA23695@host2.jankratochvil.net> <52D014B7.6040305@redhat.com> <52D6FEA9.6010605@linux.vnet.ibm.com> <52D7EEA9.4030006@redhat.com> Date: Fri, 17 Jan 2014 17:58:00 -0000 In-Reply-To: <52D7EEA9.4030006@redhat.com> (Pedro Alves's message of "Thu, 16 Jan 2014 14:37:29 +0000") Message-ID: <874n5232yj.fsf@br87z6lw.de.ibm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14011717-8372-0000-0000-0000085C9BFA X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00680.txt.bz2 On Thu, Jan 16 2014, Pedro Alves wrote: > On 01/15/2014 09:33 PM, Edjunior Barbosa Machado wrote: >> > >>> testsuite/ >>> 2014-01-10 Andreas Arnez >>> Pedro Alves >>> >>> * gdb.dwarf2/dw2-dir-file-name.c (FUNC): Remove "*_start" symbol. >>> Make "name" extern. >>> * gdb.dwarf2/dw2-dir-file-name.exp (out_cu, out_line): Replace >>> references to ${name}_start by references to ${name}. >> >> For some reason, the testcase is no longer successful on ppc64 (although it >> still passes on ppc32): it hits the breakpoints, but no longer shows the >> filename in none of the tests. >> >> From gdb.log: >> ... >> (gdb) break compdir_missing__ldir_missing__file_basename >> Breakpoint 2 at 0x100006c4 >> (gdb) continue >> Continuing. >> >> Breakpoint 2, 0x00000000100006c4 in .compdir_missing.ldir_missing.file_basename () > > Bah, looks like the function's low_pc ends up pointing to the function > descriptor (because that's what the "name" symbol resolves to in the > debug info in the .S file)? Looks like we'll need some other solution. OK, how about this? ---- Subject: [PATCH] Re-introduce '_start' labels and add alignment in dw2-dir-file-name test case. On ppc64-linux a function symbol does not point to code, but to the function descriptor. Thus the previous change for this test case broke it: https://sourceware.org/ml/gdb-patches/2014-01/msg00275.html This patch reverts to the original method, re-introducing '_start' symbols. In addition, it adds sufficient alignment before the label, such that the label never points into an alignment gap. testsuite/ 2014-01-17 Andreas Arnez * gdb.dwarf2/dw2-dir-file-name.c (FUNC): Insert alignment and define "*_start" label. Make "name" static. * gdb.dwarf2/dw2-dir-file-name.exp: Replace references to ${name} by references to ${name}_start. --- gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c | 10 +++++++++- gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.exp | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c index 2b9cc6a..517df90 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-dir-file-name.c @@ -63,8 +63,16 @@ FUNC (compdir_absolute_ldir_absolute_file_relative_different) \ FUNC (compdir_absolute_ldir_absolute_file_absolute_same) \ FUNC (compdir_absolute_ldir_absolute_file_absolute_different) +/* Notes: (1) The '*_start' label below is needed because 'name' may + point to a function descriptor instead of to the actual code. (2) + The '.balign' should specify the highest possible function + alignment across all supported architectures, such that the label + never points into the alignment gap. */ + #define FUNC(name) \ - void \ + asm (".balign 8"); \ + asm (#name "_start: .globl " #name "_start\n"); \ + static 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 e523e89..7f29581 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} /* DW_AT_low_pc */ + .4byte ${name}_start /* 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} /* DW_AT_low_pc */ + .4byte ${name}_start /* 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} + .4byte ${name}_start .byte 1 /* DW_LNS_copy */ .byte 3 /* DW_LNS_advance_line */ .sleb128 1 /* ... to 1000 */ -- 1.7.1