Don't handle unavailable/optimized-out in spu_software_single_step
authorYao Qi <yao.qi@linaro.org>
Fri, 11 Nov 2016 16:50:42 +0000 (16:50 +0000)
committerYao Qi <yao.qi@linaro.org>
Fri, 11 Nov 2016 16:50:42 +0000 (16:50 +0000)
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/ChangeLog
gdb/spu-tdep.c

index 7fc2b4a9fe10e56d2c6df9b3061f368551eecbf5..99edafca61c66a2b163a26d7eadf486b259d0a9d 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2016-11-11  Yao Qi  <yao.qi@linaro.org>
 
        * cp-valprint.c (cp_print_value): Remove local base_valaddr.
index 5494a93d2ae9413a6640440cd3a112d7cab3ffd8..073be2d718967e3c38f34a2214f42d9241a6cd0b 100644 (file)
@@ -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)