Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>,
	Tom Tromey <tom@tromey.com>,
	Pedro Alves via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2 3/3] Make exec-file-mismatch compare build IDs
Date: Thu, 21 May 2020 15:02:49 +0100	[thread overview]
Message-ID: <437fb053-a1e0-67de-0f0e-6a14fb95bf90@redhat.com> (raw)
In-Reply-To: <4719db5fbbd5f3b4026bf4b7637ce922d24e8c6b.camel@skynet.be>

On 5/21/20 2:32 PM, Philippe Waroquiers wrote:

> Comparing build-id introduced a change of behaviour when GDB has
> loaded a file, and the user recompiles this file followed by an attach.
> 
> Before this patch, when GDB had a file loaded and the user recompiled
> the file and attached to a process using this recompiled file,
> GDB used to reload the file automatically.
> Now, GDB reports a mismatch, indicating  a "mismatch"
> instead of automatically re-loading the new file version.
> 
> Technically, GDB mismatch is correct, but I am wondering if this change
> of behaviour is desirable.  At least, it introduces a difference
> of behaviour between run (that will just indicate the file has changed
> and reload automatically) and attach (that will warn and ask).
> 
> 
>  (gdb) atta 10615
> Attaching to program: /bd/home/philippe/gdb/git/build_moreaa/gdb/gdb, process 10615
> [New LWP 10616]
> [New LWP 10617]
> [New LWP 10618]
> [New LWP 10620]
> [New LWP 10621]
> [New LWP 10622]
> [New LWP 10623]
> warning: Mismatch between current exec-file /bd/home/philippe/gdb/git/build_moreaa/gdb/gdb
> and automatically determined exec-file /bd/home/philippe/gdb/git/build_moreaa/gdb/gdb
> exec-file-mismatch handling is currently "ask"
> Load new symbol table from "/bd/home/philippe/gdb/git/build_moreaa/gdb/gdb"? (y or n) 
> 
> 
> while previously, GDB was doing:
> (gdb) atta 14099
> Attaching to program: /bd/home/philippe/gdb/git/build_moreaa/gdb/gdb, process 14099
> [New LWP 14100]
> [New LWP 14101]
> [New LWP 14102]
> [New LWP 14104]
> [New LWP 14105]
> [New LWP 14106]
> [New LWP 14107]
> `/bd/home/philippe/gdb/git/build_moreaa/gdb/gdb' has changed; re-reading symbols.

It looks to me like GDB is doing the validation too soon.  It should figure out
that the local file changed, and thus reload it (the "re-reading symbols"), and only
after, should it do validation?  After re-reading, the build ids should match again.
Or do the "has changed, re-reading" thing earlier, but not sure that's practical.

Thanks,
Pedro Alves



  reply	other threads:[~2020-05-21 14:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 18:04 [PATCH 0/3] " Pedro Alves
2020-05-17 18:04 ` [PATCH 1/3] Default gdb_bfd_open's fd parameter to -1 Pedro Alves
2020-05-17 18:04 ` [PATCH 2/3] Eliminate target_fileio_open_warn_if_slow Pedro Alves
2020-05-17 18:04 ` [PATCH 3/3] Make exec-file-mismatch compare build IDs Pedro Alves
2020-05-17 18:25   ` Eli Zaretskii
2020-05-18 13:52     ` Pedro Alves
2020-05-18 13:55   ` [PATCH v2 " Pedro Alves
2020-05-18 14:21     ` Philippe Waroquiers
2020-05-19 15:43       ` Pedro Alves
2020-05-19 16:04     ` Tom Tromey
2020-05-19 17:44       ` Pedro Alves
2020-05-21 13:32         ` Philippe Waroquiers
2020-05-21 14:02           ` Pedro Alves [this message]
2020-05-21 14:23             ` Philippe Waroquiers
2020-05-21 14:27               ` Pedro Alves

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=437fb053-a1e0-67de-0f0e-6a14fb95bf90@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=philippe.waroquiers@skynet.be \
    --cc=tom@tromey.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