Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Don't handle unavailable/optimized-out in spu_software_single_step
@ 2016-11-11 14:16 Yao Qi
  2016-11-11 14:41 ` Ulrich Weigand
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2016-11-11 14:16 UTC (permalink / raw)
  To: gdb-patches

When we do software single step, frame is always the innermost one,
so it is impossible to get unavailable/optimized-out errors.

gdb:

2016-11-11  Yao Qi  <yao.qi@linaro.org>

	* spu-tdep.c (spu_software_single_step): Don't call
	get_frame_register_bytes, call get_frame_register_unsigned
	instead.
---
 gdb/spu-tdep.c | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 5494a93..073be2d 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1652,24 +1652,7 @@ spu_software_single_step (struct frame_info *frame)
       if (reg == SPU_PC_REGNUM)
 	target += SPUADDR_ADDR (pc);
       else if (reg != -1)
-	{
-	  int optim, unavail;
-
-	  if (get_frame_register_bytes (frame, reg, 0, 4, buf,
-					 &optim, &unavail))
-	    target += extract_unsigned_integer (buf, 4, byte_order) & -4;
-	  else
-	    {
-	      if (optim)
-		throw_error (OPTIMIZED_OUT_ERROR,
-			     _("Could not determine address of "
-			       "single-step breakpoint."));
-	      if (unavail)
-		throw_error (NOT_AVAILABLE_ERROR,
-			     _("Could not determine address of "
-			       "single-step breakpoint."));
-	    }
-	}
+	target += get_frame_register_unsigned (frame, reg) & -4;
 
       target = target & lslr;
       if (target != next_pc)
-- 
1.9.1


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

end of thread, other threads:[~2016-11-11 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-11 14:16 [PATCH] Don't handle unavailable/optimized-out in spu_software_single_step Yao Qi
2016-11-11 14:41 ` Ulrich Weigand
2016-11-11 20:43   ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox