From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12916 invoked by alias); 16 Jan 2014 12:35:53 -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 12866 invoked by uid 89); 16 Jan 2014 12:35:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 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; Thu, 16 Jan 2014 12:35:52 +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 s0GCZmxD002617 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 16 Jan 2014 07:35:48 -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 s0GCZkZ3028629; Thu, 16 Jan 2014 07:35:47 -0500 Message-ID: <52D7D222.9020403@redhat.com> Date: Thu, 16 Jan 2014 12:35: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: Omair Javaid CC: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH] testsuite/gdb.dwarf2: Fix for dw2-ifort-parameter failure on ARM References: <51E4B587.70007@codesourcery.com> <5280A528.8040308@codesourcery.com> <52D7A05F.6070304@linaro.org> <52D7AAF1.80501@redhat.com> <52D7B3C5.1000702@linaro.org> In-Reply-To: <52D7B3C5.1000702@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00599.txt.bz2 On 01/16/2014 10:26 AM, Omair Javaid wrote: > > > On 01/16/2014 02:48 PM, Pedro Alves wrote: >> On 01/16/2014 09:03 AM, Omair Javaid wrote: >> >>> There seemed no problem with how breakpoint addresses were being adjusted. >>> This test requires to build dwarf info by hand in dw2-ifort-parameter-debug.S >>> using compile time addresses so in case of arm (thumb mode) the least >>> significant bits of compile time address are set to 1. For that reason >>> 0x000083bd was being used as a breakpoint address func. >> >> OOC, what does the compiler debug info usually do instead to avoid this? >> > > Here is what compiler generates when there are thumb functions to handle: > .thumb_func > .type func, %function > func: > .LFB0: > > func is marked as thumb function and thus this func pointer will have the > lower bit set. While .LFB0: non thumb label will be used to mark function > start address. Like this: .4byte .LFB0 @ DW_AT_low_pc Ah. I wonder if this works for you (and everyone). --- gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S | 4 ++-- gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S index c7dd9be..6b08cb2 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S +++ b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter-debug.S @@ -35,8 +35,8 @@ .uleb128 2 /* Abbrev: DW_TAG_subprogram */ .byte 1 /* DW_AT_external */ .ascii "func\0" /* DW_AT_name */ - .4byte func /* DW_AT_low_pc */ - .4byte main /* DW_AT_high_pc */ + .4byte func_addr /* DW_AT_low_pc */ + .4byte main_addr /* DW_AT_high_pc */ .uleb128 3 /* Abbrev: DW_TAG_formal_parameter */ .ascii "param\0" /* DW_AT_name */ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c index 361c44d..c866b0f 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter.c @@ -29,3 +29,9 @@ main (void) func (); return 0; } + +/* Addresses represented as data symbols, thus without Thumb (etc.) + mode bits. The dw2-ifort-parameter-debug.S file uses this as + func's low_pc/high_pc. */ +extern void *func_addr __attribute__ ((alias ("func"))); +extern void *main_addr __attribute__ ((alias ("main"))); -- 1.7.11.7