From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22334 invoked by alias); 16 Jan 2014 13:55:29 -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 22324 invoked by uid 89); 16 Jan 2014 13:55:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_WEB,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ee0-f46.google.com Received: from mail-ee0-f46.google.com (HELO mail-ee0-f46.google.com) (74.125.83.46) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 16 Jan 2014 13:55:27 +0000 Received: by mail-ee0-f46.google.com with SMTP id c13so1434419eek.33 for ; Thu, 16 Jan 2014 05:55:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=I+v26+mQIsZJaOUXDzHzRQjSsisNnhFYJjId7hLKcwo=; b=b/qnGIUz79KCFB5OevzG7RW4438vOkHHPZNA6zV/l5w2lfsqeaks4J0FlRDDdur+qL zaiveutDY5J4XebGY7x8aFy9k8sDrIqYOZM8K5OfGg26nc/06Chq9EFl2vRgm7Yr0jfW a0D7uhhBNFZANEx0UWp210IA4kC2GSXdr9OmDT3S5ShKTua5+/6lIixefMg4txI0WjBR LHI+ziubIUipGdxKQKJb5obLAjz02GYt5c6I/fJ8tbb/OPtBzqG27aBGnAXz62rfrFN6 /hQ+C4tzV3mQQY2qvYnL7m+sDwp5eanK6+foIUwMFRe1gM/Rj65EBMM+GtqbmsuWK4Ut rhbw== X-Gm-Message-State: ALoCoQlf2FthK3fZlU4CgTM3WkJRm49ql0gYE3lZ3O2lx+6e4QEBiNMf4/fBqA85HBOo1c7Ut+QM X-Received: by 10.14.0.201 with SMTP id 49mr12645196eeb.38.1389880521707; Thu, 16 Jan 2014 05:55:21 -0800 (PST) Received: from [192.168.1.102] ([182.185.178.235]) by mx.google.com with ESMTPSA id z46sm18291662een.1.2014.01.16.05.55.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 16 Jan 2014 05:55:20 -0800 (PST) Message-ID: <52D7E4C5.4040504@linaro.org> Date: Thu, 16 Jan 2014 13:55:00 -0000 From: Omair Javaid User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Pedro Alves 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> <52D7D222.9020403@redhat.com> In-Reply-To: <52D7D222.9020403@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00605.txt.bz2 On Thu 16 Jan 2014 05:35:46 PM PKT, Pedro Alves wrote: > 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"))); Patch doesnt fix the issue and builds after making changes to alias definition like: extern void func_addr() __attribute__ ((alias ("func"))); extern void main_addr() __attribute__ ((alias ("main"))); I have actually tried similar stuff before by adding: asm(".globl func_addr"); asm(".4byte func_addr"); but issues remains the same. Heres the output with your patch: warning: Breakpoint address adjusted from 0x000083c5 to 0x000083c4. Breakpoint 1 at 0x83c4 (2 locations) (gdb) run Starting program: /home/omair/gdb_dev/gdb/gdb/testsuite/gdb.dwarf2/dw2-ifort-parameter warning: Breakpoint address adjusted from 0x000083c5 to 0x000083c4. warning: Breakpoint address adjusted from 0x000083c5 to 0x000083c4. warning: Breakpoint address adjusted from 0x000083c5 to 0x000083c4. warning: Breakpoint 1 address previously adjusted from 0x000083c5 to 0x000083c4. Breakpoint 1, 0x000083c4 in func_addr () (gdb) p/x param No symbol "param" in current context. (gdb) FAIL: gdb.dwarf2/dw2-ifort-parameter.exp: p/x param testcase ./gdb.dwarf2/dw2-ifort-parameter.exp completed in 1 seconds