[PATCH v2 0/8] software single-step support rework, fix limitations

Pedro Alves palves@redhat.com
Fri Oct 3 13:54:00 GMT 2014


Here's v2 of the series that reworks software single-step support.

v1 was here:
  https://sourceware.org/ml/gdb-patches/2014-09/msg00755.html

In a nutshell, this series:

- Makes single-step breakpoints regular breakpoints and puts them on
  the global location chain.

- Makes the moribund location machinery aware of software single-step
  breakpoints.

- Removes the currently limitation that only 2 single-step breakpoints
  can be inserted.  Some archs, like PPC, need this.

- Makes software single-step work when stepping through read-only code
  regions.

- Fixes PR breakpoints/9649

  An assertion failure caused by leaving stale single-step breakpoints
  behind on error.

- Adds support for having multiple threads software single-stepping
  simultaneously.  Currently, in non-stop, all single-step requests
  are handled by displaced stepping the threads, which means threads
  are serialized, because only one thread can be displaced stepping at
  any given time.

- Finally eliminates deprecated_insert_raw_breakpoint and friends.

- Removes a set of run control globals along the way.

- Cleans things up here and there.

In v2:

 - Yao's review comments addressed:

    Fixed failure to clear the single_step_breakpoints global.

    Skip adjusting breakpoint address of bp_single_step breakpoints
    (in adjust_breakpoint_address)

 - patch #5 (Switch back to stepped thread: clear step-over info)
   folded into patch #3 (Put single-step breakpoints on the
   bp_location chain), and comment expanded.

 - old patch #7 (infrun.c: add for_each_just_stopped_thread) moved
   earlier in the series, to make use of
   delete_just_stopped_threads_infrun_breakpoints in patch #3.

 - New test added to patch #3 that tests stepping through read-only
   regions.  That uncovered PR 9649 was still alive in v1.  v2 now
   fixes that.

v2 tested on:

 - x86_64 Fedora 20
 - x86_64 Fedora 20 w/ 'software single-step on x86' series

v1 had been tested on PPC64 Fedora 18 too, to test the non-continuable
watchpoints patch.  As that patch is unchanged in this revision, I
didn't bother to retest there.

Pedro Alves (8):
  Decide whether we may have removed breakpoints based on step_over_info
  Rewrite non-continuable watchpoints handling
  infrun.c: add for_each_just_stopped_thread
  Put single-step breakpoints on the bp_location chain
  Remove deprecated_insert_raw_breakpoint and friends
  thread.c: cleanup breakpoint deletion
  Make single-step breakpoints be per-thread
  Non-stop + software single-step archs: don't force displaced-stepping
    for all single-steps

 gdb/breakpoint.c                                   | 413 ++++++---------------
 gdb/breakpoint.h                                   |  31 +-
 gdb/gdbthread.h                                    |  25 ++
 gdb/infrun.c                                       | 360 ++++++++----------
 gdb/infrun.h                                       |   4 +
 gdb/record-full.c                                  |   8 +-
 gdb/testsuite/gdb.base/breakpoint-in-ro-region.c   |   9 +
 gdb/testsuite/gdb.base/breakpoint-in-ro-region.exp | 104 ++++++
 gdb/thread.c                                       |  80 +++-
 9 files changed, 490 insertions(+), 544 deletions(-)

-- 
1.9.3



More information about the Gdb-patches mailing list