public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: gdb-patches@sourceware.org
Subject: [RFA 1/3] New option 'set exec-file-mismatch (reload|warn|off)'.  Fixes PR gdb/17626.
Date: Sat, 21 Dec 2019 14:36:00 -0000	[thread overview]
Message-ID: <20191221143632.15990-1-philippe.waroquiers@skynet.be> (raw)

New option 'set exec-file-mismatch (reload|warn|off)'.  Fixes PR gdb/17626.

This option allows to tell GDB to detect and possibly handle mismatched
exec-files.

A recurrent problem with GDB is that GDB uses the wrong exec-file
when using the attach/detach commands successively.
Also, in case the user specifies a file on the command line but attaches
to the wrong PID, this error is not made visible and gives a not user
understandable behaviour.

RFA 1/3 Implement 'set/show exec-file-mismatch'.
   implements the option.
RFA 2/2 modifies gdb.base/attach.exp to test the option.
RFA 3/3 documents the option in NEWS and in gdb.texinfo

Compared to the RFC, this version handles the comments of Tom.

Some feedback related to these comments:
  * I have styled the warning/error messages mentionning files in
    exec.c, but styling in such messages only works with the patch:
      [RFA] Ensure GDB warnings are styled.
      https://sourceware.org/ml/gdb-patches/2019-12/msg00691.html

  * Related to new lines in the warning message: many other warning
    messages have new lines.  I have kept them, as it looks to me that
    the message is more clear like that.  Of course, I can remove them
    if deemed better without.

  * What happens if the inferior execs another program ?
    This option only controls the behaviour when attaching to a running
    program.  The behaviour of 'exec' is not changed: GDB already properly
    determines the executable to use after exec.



             reply	other threads:[~2019-12-21 14:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-21 14:36 Philippe Waroquiers [this message]
2019-12-21 14:36 ` [RFA 3/3] Document 'set|show exec-file-mismatch (reload|warn|off)' Philippe Waroquiers
2019-12-21 17:44   ` Eli Zaretskii
2019-12-21 20:16     ` Philippe Waroquiers
2019-12-22 18:20       ` Eli Zaretskii
2019-12-22  2:46   ` Christian Biesinger via gdb-patches
2019-12-22  9:09     ` Philippe Waroquiers
2020-01-08  0:52     ` Tom Tromey
2019-12-21 14:36 ` [RFA 2/3] Test 'set exec-file-mismatch reload|warn|off' Philippe Waroquiers
2019-12-21 14:36 ` [RFA 1/3] Implement 'set/show exec-file-mismatch' Philippe Waroquiers
2020-01-08  0:58   ` Tom Tromey

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=20191221143632.15990-1-philippe.waroquiers@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --cc=gdb-patches@sourceware.org \
    /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).