public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Don Breazeal <donb@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 0/2] Native follow-exec-mode cleanup
Date: Tue, 25 Aug 2015 22:41:00 -0000	[thread overview]
Message-ID: <1440542496-14988-1-git-send-email-donb@codesourcery.com> (raw)

This patchset implements a test for follow-exec-mode and addresses
several failures in the native implementation of follow-exec-mode.

I submitted a patchset several weeks ago that purported to implement
exec events and follow-exec-mode for extended-remote Linux targets
(https://sourceware.org/ml/gdb-patches/2015-07/msg00923.html).
That had an issue with one of the follow-exec-mode cases.  As part
of working on that I implemented a test for follow-exec-mode
(gdb.base/foll-exec.exp doesn't test follow-exec-mode, it only tests
exec event handling).  When I ran the test against the native x64
Linux debugger, I found several failures.  There was no point in
submitting updates to the extended-remote exec event patchset until
these issues had been dealt with.

Issues:
---------
First, if there is a breakpoint in the original program that doesn't
map to a location in the execd program (e.g. on a line number in a
file that doesn't exist in the execd program), GDB gets "Error in
re-setting breakpoint".

After attempting a fix, I concluded that this error is benign, and
actually informative.  It lets the user know that a breakpoint did
not survive across the exec.  So I left this alone.  Make sense?

Second, with follow-exec-mode == "new" and using 'next' across the
exec call, GDB segfaulted.  Once that was fixed, there were a couple
of other issues to clean up.

Finally, I tried using 'next' across a call to exec after deleting
all breakpoints.  In this case the execed program runs to completion.
In breakpoint.c:update_breakpoints_after_exec the comments make it
clear that this is not expected to work.  It seems like it might be
possible to make such a thing work, but it's beyond the scope of
what I'm working on now.

So ultimately this patchset only implements the test and fixes the
segfault.

Patch 1/2: Implement gdb.base/foll-exec-2.exp to test follow-exec-mode.

Patch 2/2: Fix native follow-exec-mode "new".

Tested all on native x86_64 Linux.

Thanks
--Don

             reply	other threads:[~2015-08-25 22:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-25 22:41 Don Breazeal [this message]
2015-08-25 22:41 ` [PATCH 1/2] Test follow-exec-mode Don Breazeal
2015-08-26 10:31   ` Pedro Alves
2015-08-26 21:27     ` [pushed] " Don Breazeal
2015-08-25 22:42 ` [PATCH 2/2] Fix native follow-exec-mode "new" Don Breazeal
2015-08-26 10:41   ` Pedro Alves
2015-08-26 21:28     ` [pushed] " Don Breazeal

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=1440542496-14988-1-git-send-email-donb@codesourcery.com \
    --to=donb@codesourcery.com \
    --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).