public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/8] Step over instruction branches to itself
@ 2016-03-04 10:44 Yao Qi
  2016-03-04 10:44 ` [PATCH 3/8] Deliver signal in hardware single step Yao Qi
                   ` (7 more replies)
  0 siblings, 8 replies; 29+ messages in thread
From: Yao Qi @ 2016-03-04 10:44 UTC (permalink / raw)
  To: gdb-patches

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.

Patch 1 and 2 are refactor patch.  Patch 4 is a GDB patch, and the rest
of them are GDBserver patches.  Test case is in the last patch.  Patch 3
and patch 7 are about signal delivery when stepping over, I am not very
sure about them, so these two can be treated as RFC.

Regression tested on x86_64-linux and arm-linux.

*** BLURB HERE ***

Yao Qi (8):
  Set signal to 0 after enqueue_pending_signal
  Check LWP_SIGNAL_CAN_BE_DELIVERED for enqueue/dequeue pending signals
  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                          |  5 ++-
 gdb/gdbserver/linux-low.c                 | 66 +++++++++++++++++-------------
 gdb/gdbserver/mem-break.c                 | 19 ++++++++-
 gdb/testsuite/gdb.base/branch-to-self.c   | 44 ++++++++++++++++++++
 gdb/testsuite/gdb.base/branch-to-self.exp | 67 +++++++++++++++++++++++++++++++
 5 files changed, 171 insertions(+), 30 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/branch-to-self.c
 create mode 100644 gdb/testsuite/gdb.base/branch-to-self.exp

-- 
1.9.1

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

end of thread, other threads:[~2016-03-21  9:40 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-04 10:44 [PATCH 0/8] Step over instruction branches to itself Yao Qi
2016-03-04 10:44 ` [PATCH 3/8] Deliver signal in hardware single step Yao Qi
2016-03-11 11:05   ` Pedro Alves
2016-03-11 11:09     ` Pedro Alves
2016-03-11 11:37       ` Pedro Alves
2016-03-16 10:47         ` Yao Qi
2016-03-17 12:12           ` Pedro Alves
2016-03-04 10:44 ` [PATCH 1/8] Set signal to 0 after enqueue_pending_signal Yao Qi
2016-03-11 10:53   ` Pedro Alves
2016-03-18 14:36     ` Yao Qi
2016-03-04 10:44 ` [PATCH 6/8] [GDBserver] Don't error in reinsert_raw_breakpoint if bp->inserted Yao Qi
2016-03-04 10:44 ` [PATCH 2/8] Check LWP_SIGNAL_CAN_BE_DELIVERED for enqueue/dequeue pending signals Yao Qi
2016-03-11 10:55   ` Pedro Alves
2016-03-17  8:40     ` Yao Qi
2016-03-17 11:07       ` Pedro Alves
2016-03-18 14:36         ` Yao Qi
2016-03-16 17:02   ` Luis Machado
2016-03-04 10:44 ` [PATCH 7/8] Resume the inferior with signal rather than stepping over Yao Qi
2016-03-11 12:04   ` Pedro Alves
2016-03-21  9:40     ` Yao Qi
2016-03-04 10:44 ` [PATCH 4/8] Force to insert software single step breakpoint Yao Qi
2016-03-11 11:49   ` Pedro Alves
2016-03-16 11:47     ` Yao Qi
2016-03-17 12:40       ` Pedro Alves
2016-03-18 14:25         ` Yao Qi
2016-03-18 15:03           ` Pedro Alves
2016-03-04 10:45 ` [PATCH 8/8] New test case gdb.base/branch-to-self.exp Yao Qi
2016-03-04 10:45 ` [PATCH 5/8] Insert breakpoint even when the raw breakpoint is found Yao Qi
2016-03-11 11:54   ` Pedro Alves

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