From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7570 invoked by alias); 30 Apr 2010 16:58:16 -0000 Received: (qmail 7555 invoked by uid 22791); 30 Apr 2010 16:58:15 -0000 X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SARE_MSGID_LONG45,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Apr 2010 16:58:09 +0000 Received: from kpbe16.cbf.corp.google.com (kpbe16.cbf.corp.google.com [172.25.105.80]) by smtp-out.google.com with ESMTP id o3UGw7Ag027886 for ; Fri, 30 Apr 2010 09:58:07 -0700 Received: from pzk5 (pzk5.prod.google.com [10.243.19.133]) by kpbe16.cbf.corp.google.com with ESMTP id o3UGw5fx013463 for ; Fri, 30 Apr 2010 09:58:06 -0700 Received: by pzk5 with SMTP id 5so235309pzk.14 for ; Fri, 30 Apr 2010 09:58:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.251.13 with SMTP id y13mr1132428rvh.116.1272646685812; Fri, 30 Apr 2010 09:58:05 -0700 (PDT) Received: by 10.141.91.13 with HTTP; Fri, 30 Apr 2010 09:58:05 -0700 (PDT) In-Reply-To: <1272643300.25147.14.camel@e102111-lin.cambridge.arm.com> References: <1272643300.25147.14.camel@e102111-lin.cambridge.arm.com> Date: Fri, 30 Apr 2010 16:58:00 -0000 Message-ID: Subject: Re: [RFA] Fix display of entry point address From: Doug Evans To: Matthew Gretton-Dann Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes 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 X-SW-Source: 2010-04/txt/msg00999.txt.bz2 On Fri, Apr 30, 2010 at 9:01 AM, Matthew Gretton-Dann wrote: > Hi, > > Please can someone review the attached patch? > > When displaying the entry point to a file (for instance as part of the > output of `info files') gdb prints the raw address it has calculated. > This is misleading on some platforms (notably on ARM when the entry > point is to a Thumb-state function) as the address will contain > additional information. > > For example (from the break-entry.exp test): > > (gdb) file /home/mgretton/gdb/build/gdb/testsuite/gdb.base/break-entry > Reading symbols from /home/mgretton/gdb/build/gdb/testsuite/gdb.base/brea= k-entry...(no debugging symbols found)...done. > (gdb) info files > Symbols from "/home/mgretton/gdb/build/gdb/testsuite/gdb.base/break-entry= ". > Local exec file: > =A0 =A0 =A0 =A0`/home/mgretton/gdb/build/gdb/testsuite/gdb.base/break-ent= ry', file type elf32-littlearm. > =A0 =A0 =A0 =A0Entry point: 0x8171 > > This is confusing as trying to set a breakpoint at 0x8171 causes a > warning like the following to be displayed: > > (gdb) break *0x8171 > warning: Breakpoint address adjusted from 0x00008171 to 0x00008170. > Breakpoint 1 at 0x8170 > > The attached patch changes gdb's behaviour to strip the arch specific > bits off the entry point before displaying it. > > A testsuite run shows no regressions, and the gdb.base/break-entry.exp > test now passes in its entirety. > > Suggested ChangeLog entry: > > 2010-04-30 =A0Matthew Gretton-Dann =A0 > > =A0 =A0 =A0 =A0* exec.c (print_section_info): Display entry point without= arch > =A0 =A0 =A0 =A0specific parts. > > Thanks, > > Matt > > -- > Matthew Gretton-Dann > Principal Engineer - Tools, PD Software > ARM Limited > Hi. I'd give it a day to see if someone else comments, but the patch is ok to me.