This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 0/2] Native follow-exec-mode cleanup


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]