Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <aristovski@qnx.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Raphael Zulliger <zulliger@indel.ch>, <gdb@sourceware.org>
Subject: Re: Ensure correct symbol-file when attaching to a (remote) process
Date: Fri, 21 Dec 2012 21:12:00 -0000	[thread overview]
Message-ID: <50D4D099.3030601@qnx.com> (raw)
In-Reply-To: <20121221161114.GA32638@host2.jankratochvil.net>

On 12-12-21 11:11 AM, Jan Kratochvil wrote:
> On Fri, 21 Dec 2012 07:05:37 +0100, Raphael Zulliger wrote:
>> Is there really no such mechanism in GDB?
>
> There is no such reliable mechanism in general.
>
> One could verify build-id in the target, probably that the build-id note is at
> the same VMA as present in the local symbol file.
>
> But then also many binaries/compilers do not provide build-id by default (ld
> option --build-id).

Interesting timing. I have just posted 
http://sourceware.org/ml/gdb-patches/2012-12/msg00776.html addressing 
this issue.

The check is not exhaustive, but for most practical purposes it should 
suffice. It verifies that in-memory elf header and pheaders match those 
found in the bfd.

Of course it will not detect difference in all cases, e.g. very small 
changes that do not affect loadable segment size. Example:

- static int foo;
- static int bar;
+ static int bar;
+ static int foo;

Still, it should be much better than no check at all.

---
Aleksandar


  parent reply	other threads:[~2012-12-21 21:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-21  6:05 Raphael Zulliger
2012-12-21 16:11 ` Jan Kratochvil
2012-12-21 18:17   ` John Gilmore
2013-01-02 17:57     ` Pedro Alves
2013-01-12 10:59       ` Martin Runge
     [not found]       ` <50EA78FB.3040609@indel.ch>
2013-01-14 18:57         ` Pedro Alves
2013-01-29  3:18       ` Raphael Zulliger
2013-01-29  3:51         ` Raphael Zulliger
2013-02-06 18:47           ` Tom Tromey
2012-12-21 21:12   ` Aleksandar Ristovski [this message]
2012-12-22  0:38     ` John Gilmore
2012-12-22  2:54       ` Aleksandar Ristovski
2012-12-24 20:02         ` Aleksandar Ristovski
2012-12-26  0:47           ` John Gilmore
2012-12-27 20:13             ` Aleksandar Ristovski
2013-01-29  3:18     ` Raphael Zulliger

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=50D4D099.3030601@qnx.com \
    --to=aristovski@qnx.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=zulliger@indel.ch \
    /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