public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Don't call set_gdbarch_cannot_step_breakpoint in aarch64_gdbarch_init
@ 2015-03-17 12:21 Yao Qi
  2015-03-20 10:17 ` Yao Qi
  2015-03-20 17:43 ` Pedro Alves
  0 siblings, 2 replies; 3+ messages in thread
From: Yao Qi @ 2015-03-17 12:21 UTC (permalink / raw)
  To: gdb-patches

From: Yao Qi <yao.qi@linaro.org>

Hi,
I am looking at the following fails in aarch64-linux,

stepi^M
47        NOP; /* after permanent bp */^M
(gdb) FAIL: gdb.base/bp-permanent.exp: always_inserted=off, sw_watchpoint=0: stepi signal with handler: single-step to handler

the test expects GDB single step into signal handler, but GDB doesn't.
The code in infrun.c:resume

      /* Most targets can step a breakpoint instruction, thus
	 executing it normally.  But if this one cannot, just
	 continue and we will hit it anyway.  */
      if (gdbarch_cannot_step_breakpoint (gdbarch))
	step = 0;

change the intended action from "step" to "continue".  The gdbarch method
cannot_step_breakpoint isn't documented well, and I don't get much clue
after explore the history.  However, from the comments above,
aarch64-linux can step a breakpoint instruction, so don't need to call
set_gdbarch_cannot_step_breakpoint.

Regression tested on aarch64-linux, both native and gdbserver.

gdb:

2015-03-17  Yao Qi  <yao.qi@linaro.org>

	* aarch64-tdep.c (aarch64_gdbarch_init): Don't call
	set_gdbarch_cannot_step_breakpoint.
---
 gdb/aarch64-tdep.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 472ce70..ddc9022 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -2698,7 +2698,6 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 
   /* Breakpoint manipulation.  */
   set_gdbarch_breakpoint_from_pc (gdbarch, aarch64_breakpoint_from_pc);
-  set_gdbarch_cannot_step_breakpoint (gdbarch, 1);
   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
   set_gdbarch_software_single_step (gdbarch, aarch64_software_single_step);
 
-- 
1.9.1

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

* Re: [PATCH] Don't call set_gdbarch_cannot_step_breakpoint in aarch64_gdbarch_init
  2015-03-17 12:21 [PATCH] Don't call set_gdbarch_cannot_step_breakpoint in aarch64_gdbarch_init Yao Qi
@ 2015-03-20 10:17 ` Yao Qi
  2015-03-20 17:43 ` Pedro Alves
  1 sibling, 0 replies; 3+ messages in thread
From: Yao Qi @ 2015-03-20 10:17 UTC (permalink / raw)
  To: gdb-patches

On 17/03/15 12:21, Yao Qi wrote:
> gdb:
>
> 2015-03-17  Yao Qi<yao.qi@linaro.org>
>
> 	* aarch64-tdep.c (aarch64_gdbarch_init): Don't call
> 	set_gdbarch_cannot_step_breakpoint.

I've pushed it in.

-- 
Yao (齐尧)

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

* Re: [PATCH] Don't call set_gdbarch_cannot_step_breakpoint in aarch64_gdbarch_init
  2015-03-17 12:21 [PATCH] Don't call set_gdbarch_cannot_step_breakpoint in aarch64_gdbarch_init Yao Qi
  2015-03-20 10:17 ` Yao Qi
@ 2015-03-20 17:43 ` Pedro Alves
  1 sibling, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2015-03-20 17:43 UTC (permalink / raw)
  To: Yao Qi, gdb-patches

Hi Yao,

On 03/17/2015 12:21 PM, Yao Qi wrote:
> From: Yao Qi <yao.qi@linaro.org>
> 
> Hi,
> I am looking at the following fails in aarch64-linux,
> 
> stepi^M
> 47        NOP; /* after permanent bp */^M
> (gdb) FAIL: gdb.base/bp-permanent.exp: always_inserted=off, sw_watchpoint=0: stepi signal with handler: single-step to handler
> 
> the test expects GDB single step into signal handler, but GDB doesn't.
> The code in infrun.c:resume
> 
>       /* Most targets can step a breakpoint instruction, thus
> 	 executing it normally.  But if this one cannot, just
> 	 continue and we will hit it anyway.  */
>       if (gdbarch_cannot_step_breakpoint (gdbarch))
> 	step = 0;
> 
> change the intended action from "step" to "continue".  The gdbarch method
> cannot_step_breakpoint isn't documented well, and I don't get much clue
> after explore the history.  However, from the comments above,
> aarch64-linux can step a breakpoint instruction, so don't need to call
> set_gdbarch_cannot_step_breakpoint.

I wondered about this before too.  Thanks for cleaning this up.

Thanks,
Pedro Alves

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

end of thread, other threads:[~2015-03-20 17:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-17 12:21 [PATCH] Don't call set_gdbarch_cannot_step_breakpoint in aarch64_gdbarch_init Yao Qi
2015-03-20 10:17 ` Yao Qi
2015-03-20 17:43 ` 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).