public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/7 V2] Step over instruction branches to itself
@ 2016-03-23 16:10 Yao Qi
  2016-03-23 16:10 ` [PATCH 4/7] Insert breakpoint even when the raw breakpoint is found Yao Qi
                   ` (6 more replies)
  0 siblings, 7 replies; 31+ messages in thread
From: Yao Qi @ 2016-03-23 16:10 UTC (permalink / raw)
  To: gdb-patches

Here is the V2 of this series, and V1 can be found in
https://sourceware.org/ml/gdb-patches/2016-03/msg00067.html

In V2, there are some changes,

 - Add a new test case in patch 1,
 - Add more comments in patch 2 and 3, to explain some scenarios may
   happen,
 - Decrease refcount rather than free the raw breapoint in patch 4,

The original description to this patch series is:

When I test arm linux range stepping patches, fails in
gdb.base/gdb-sigterm.exp lead me taking a look.  I find gcc is quite
smart to genreate *single* branch instruction for such endless for
loop,

  for (;;); /* loop-line */

the instruction branches to itself.

   0x00008638 <+28>:    b       0x8638 <main+28>

However, current GDB and GDBserver doesn't handle this kind of
instruction very well when stepping over breakpoint on top of it.
This patch series fixes the problems when stepping over
"branch to self" instruction, and it paves the way for arm linux range
stepping patches and tracepoint patches.

Yao Qi (7):
  New test case gdb.trace/signal.exp
  Deliver signal in hardware single step
  Force to insert software single step breakpoint
  Insert breakpoint even when the raw breakpoint is found
  [GDBserver] Don't error in reinsert_raw_breakpoint if bp->inserted
  Resume the inferior with signal rather than stepping over
  New test case gdb.base/branch-to-self.exp

 gdb/breakpoint.c                          |   9 +-
 gdb/gdbarch.h                             |   5 +-
 gdb/gdbarch.sh                            |   5 +-
 gdb/gdbserver/linux-low.c                 |  22 +++-
 gdb/gdbserver/mem-break.c                 |  19 +++-
 gdb/testsuite/gdb.base/branch-to-self.c   |  44 ++++++++
 gdb/testsuite/gdb.base/branch-to-self.exp |  67 +++++++++++
 gdb/testsuite/gdb.trace/signal.c          |  68 +++++++++++
 gdb/testsuite/gdb.trace/signal.exp        | 180 ++++++++++++++++++++++++++++++
 9 files changed, 411 insertions(+), 8 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/branch-to-self.c
 create mode 100644 gdb/testsuite/gdb.base/branch-to-self.exp
 create mode 100644 gdb/testsuite/gdb.trace/signal.c
 create mode 100644 gdb/testsuite/gdb.trace/signal.exp

-- 
1.9.1

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

end of thread, other threads:[~2016-04-26 12:57 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23 16:10 [PATCH 0/7 V2] Step over instruction branches to itself Yao Qi
2016-03-23 16:10 ` [PATCH 4/7] Insert breakpoint even when the raw breakpoint is found Yao Qi
2016-04-11 14:41   ` Pedro Alves
2016-04-12  9:04     ` Yao Qi
2016-04-12  9:41       ` Pedro Alves
2016-04-25  8:45         ` Yao Qi
2016-03-23 16:10 ` [PATCH 6/7] Resume the inferior with signal rather than stepping over Yao Qi
2016-04-11 15:29   ` Pedro Alves
2016-03-23 16:10 ` [PATCH 2/7] Deliver signal in hardware single step Yao Qi
2016-04-11 14:10   ` Pedro Alves
2016-04-22 10:54     ` Yao Qi
2016-03-23 16:10 ` [PATCH 1/7] New test case gdb.trace/signal.exp Yao Qi
2016-04-08 16:52   ` Pedro Alves
2016-04-11  8:41     ` Yao Qi
2016-04-11 14:04       ` Pedro Alves
2016-04-22 10:53         ` Yao Qi
2016-04-26 12:57           ` Pedro Alves
2016-04-11 14:08       ` Pedro Alves
2016-03-23 16:10 ` [PATCH 5/7] [GDBserver] Don't error in reinsert_raw_breakpoint if bp->inserted Yao Qi
2016-04-11 14:54   ` Pedro Alves
2016-03-23 16:10 ` [PATCH 3/7] Force to insert software single step breakpoint Yao Qi
2016-04-11 14:31   ` Pedro Alves
2016-04-13 16:21     ` Yao Qi
2016-04-19 14:54     ` Yao Qi
2016-04-19 15:17       ` Pedro Alves
2016-04-20  7:50     ` Yao Qi
2016-04-22 16:36       ` Pedro Alves
2016-04-25  8:40         ` Yao Qi
2016-03-23 16:26 ` [PATCH 7/7] New test case gdb.base/branch-to-self.exp Yao Qi
2016-04-11 15:34   ` Pedro Alves
2016-04-25  8:58     ` Yao Qi

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