public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] fix permanent breakpoints
@ 2014-11-04 19:03 Pedro Alves
  2014-11-04 19:03 ` [PATCH 3/3] fix skipping " Pedro Alves
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Pedro Alves @ 2014-11-04 19:03 UTC (permalink / raw)
  To: gdb-patches

This series fixes a few permanent breakpoints things.

 - Adds a default method to gdbarch_skip_permanent_breakpoint, which
   should be right for most archs.

 - Makes permanent breakpoints be a detail of a breakpoint location
   rather than of the whole breakpoint.  Bad things happen today if a
   multi-location breakpoint happens to have some (but not all) of its
   locations on top of a breakpoint instruction.

 - Makes permanent breakpoints disablable.  If the user disables the
   breakpoint, she gets the random SIGTRAP as if she hadn't set the
   breakpoint in the first place.

 - Fixes the skip-permanent-breakpoint code to actually just skip the
   breakpoint.  GDB currently steps one instruction too much, along
   with getting other tricky details wrong.

But the reason I'm looking at this now is that a recent change of mine
regressed the gdb.arch/i386-bp_permanent.exp test.  See:

  https://sourceware.org/ml/gdb/2014-11/msg00001.html

Specifically, GDB is now hitting an assertion when skipping a
permanent breakpoint:

 (gdb) stepi
 ../../src/gdb/infrun.c:2237: internal-error: resume: Assertion `sig != GDB_SIGNAL_0' failed.
 A problem internal to GDB has been detected,
 further debugging may prove unreliable.
 Quit this debugging session? (y or n) FAIL: gdb.arch/i386-bp_permanent.exp: Single stepping past permanent breakpoint. (GDB internal error)

However, taking a closer look, the problem is in permanent
breakpoint's code, not on the assertion itself.  That is, the
assertion caught something bogus.

I've complained about permanent breakpoints being fundamentally broken
before, at:

  https://www.sourceware.org/ml/gdb-patches/2013-10/msg00574.html

And it turns out that the new test added by this series trips on
issues related to what I mentioned in that email, and I so I ended up
having to do the changes I proposed in that email...

Tested on x86-64 Fedora 20.

Pedro Alves (3):
  add a default method for gdbarch_skip_permanent_breakpoint
  make "permanent breakpoints" per location and disableable
  fix skipping permanent breakpoints

 gdb/arch-utils.c                             |  13 +-
 gdb/arch-utils.h                             |   8 +
 gdb/breakpoint.c                             |  71 +++----
 gdb/breakpoint.h                             |  13 +-
 gdb/gdbarch.c                                |  13 +-
 gdb/gdbarch.h                                |   2 -
 gdb/gdbarch.sh                               |   2 +-
 gdb/i386-tdep.c                              |  15 --
 gdb/infrun.c                                 | 153 +++++++++++++--
 gdb/testsuite/gdb.arch/i386-bp_permanent.c   |  57 ++++++
 gdb/testsuite/gdb.arch/i386-bp_permanent.exp |  49 ++---
 gdb/testsuite/gdb.base/bp-permanent.c        | 128 +++++++++++++
 gdb/testsuite/gdb.base/bp-permanent.exp      | 276 +++++++++++++++++++++++++++
 13 files changed, 672 insertions(+), 128 deletions(-)
 create mode 100644 gdb/testsuite/gdb.arch/i386-bp_permanent.c
 create mode 100644 gdb/testsuite/gdb.base/bp-permanent.c
 create mode 100644 gdb/testsuite/gdb.base/bp-permanent.exp

-- 
1.9.3

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-11-23 10:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-04 19:03 [PATCH 0/3] fix permanent breakpoints Pedro Alves
2014-11-04 19:03 ` [PATCH 3/3] fix skipping " Pedro Alves
2014-11-05 12:26   ` Yao Qi
2014-11-07 19:53     ` Pedro Alves
2014-11-12  0:54       ` Yao Qi
2014-11-12 10:53         ` Pedro Alves
2014-11-04 19:03 ` [PATCH 1/3] add a default method for gdbarch_skip_permanent_breakpoint Pedro Alves
2014-11-04 19:03 ` [PATCH 2/3] make "permanent breakpoints" per location and disableable Pedro Alves
2014-11-05  6:37   ` Yao Qi
2014-11-12 10:55     ` Pedro Alves
2014-11-20 16:41       ` [RFA] Always consider infcall breakpoints as non-permanent Joel Brobecker
2014-11-21 11:38         ` Pedro Alves
2014-11-23 10:44           ` Joel Brobecker

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).