arm7_9_execute_sys_speed error propagation. Found by code inspection, no observed...
[fw/openocd] / src / target / arm7_9_common.c
index 62045898106744f58f4a59948f50c84385ac80d7..4fd97c5c4a319660222b76c356706076009fa2d3 100644 (file)
@@ -1567,6 +1567,7 @@ int arm7_9_resume(struct target_s *target, int current, u32 address, int handle_
                                return retval;
                        }
 
+                       /* calculate PC of next instruction */
                        u32 next_pc;
                        if ((retval = arm_simulate_step(target, &next_pc)) != ERROR_OK)
                        {
@@ -1771,6 +1772,7 @@ int arm7_9_step(struct target_s *target, int current, u32 address, int handle_br
 
        target->debug_reason = DBG_REASON_SINGLESTEP;
 
+       /* calculate PC of next instruction */
        u32 next_pc;
        if ((retval = arm_simulate_step(target, &next_pc)) != ERROR_OK)
        {
@@ -2014,9 +2016,11 @@ int arm7_9_read_memory(struct target_s *target, u32 address, u32 size, u32 count
                                 * from a sufficiently high clock (32 kHz is usually too slow)
                                 */
                                if (arm7_9->fast_memory_access)
-                                       arm7_9_execute_fast_sys_speed(target);
+                                       retval = arm7_9_execute_fast_sys_speed(target);
                                else
-                                       arm7_9_execute_sys_speed(target);
+                                       retval = arm7_9_execute_sys_speed(target);
+                               if (retval != ERROR_OK)
+                                       return retval;
 
                                arm7_9->read_core_regs_target_buffer(target, reg_list, buffer, 4);