Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix display of entry point address
Date: Fri, 30 Apr 2010 16:58:00 -0000	[thread overview]
Message-ID: <l2qe394668d1004300958i70e2473eo40689126ad33ef66@mail.gmail.com> (raw)
In-Reply-To: <1272643300.25147.14.camel@e102111-lin.cambridge.arm.com>

On Fri, Apr 30, 2010 at 9:01 AM, Matthew Gretton-Dann
<matthew.gretton-dann@arm.com> 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/break-entry...(no debugging symbols found)...done.
> (gdb) info files
> Symbols from "/home/mgretton/gdb/build/gdb/testsuite/gdb.base/break-entry".
> Local exec file:
>        `/home/mgretton/gdb/build/gdb/testsuite/gdb.base/break-entry', file type elf32-littlearm.
>        Entry 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  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
>
>        * exec.c (print_section_info): Display entry point without arch
>        specific 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.


  reply	other threads:[~2010-04-30 16:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30 16:01 Matthew Gretton-Dann
2010-04-30 16:58 ` Doug Evans [this message]
2010-04-30 21:14   ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=l2qe394668d1004300958i70e2473eo40689126ad33ef66@mail.gmail.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.org \
    --cc=matthew.gretton-dann@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox