public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Christian Biesinger via gdb" <gdb@sourceware.org>
To: Andrea Cardaci <cyrus.and@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Function address incoherence
Date: Mon, 26 Aug 2019 16:34:00 -0000	[thread overview]
Message-ID: <CAPTJ0XH=GzX4+xR_OiVcc=+r2socS0uJuF6zoNcR6=Ux+ULSbw@mail.gmail.com> (raw)
In-Reply-To: <CACMsj9PVtSb_+1gYAUaQPafUd0A-PDuQT5UpvVUWmOHExzxb=w@mail.gmail.com>

On Sat, Aug 24, 2019 at 5:27 AM Andrea Cardaci <cyrus.and@gmail.com> wrote:
> Back to the gdb-dashboard issue, I fetch the function address with
> gdb.parse_and_eval(frame.name()).address and since frame.name() is
> _start, the address that I obtain is 0x80482e0 instead of 0xb7fdba20
> thus I end up displaying wrong offsets.

Why don't you use frame.function() and get the address from there?

(and why parse_and_eval instead of lookup_symbol?)

On GDB trunk, you can look up symbols per-objfile, which can help if
multiple files have the same symbol.

Christian

  parent reply	other threads:[~2019-08-26 16:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-24 10:27 Andrea Cardaci
2019-08-26  6:54 ` Florian Weimer
2019-08-26 10:22   ` Andrea Cardaci
2019-08-26  7:55 ` Andreas Schwab
2019-08-26 10:22   ` Andrea Cardaci
2019-08-26 16:34 ` Christian Biesinger via gdb [this message]
2019-08-26 16:50   ` Andrea Cardaci
2019-08-26 17:39     ` Andrea Cardaci

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='CAPTJ0XH=GzX4+xR_OiVcc=+r2socS0uJuF6zoNcR6=Ux+ULSbw@mail.gmail.com' \
    --to=gdb@sourceware.org \
    --cc=cbiesinger@google.com \
    --cc=cyrus.and@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).