From bd7d019b56a17c133f2696ae0e16f280f01236a8 Mon Sep 17 00:00:00 2001 From: oharboe Date: Mon, 27 Apr 2009 12:02:07 +0000 Subject: more error handling git-svn-id: svn://svn.berlios.de/openocd/trunk@1543 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/target/arm11.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/target/arm11.c') diff --git a/src/target/arm11.c b/src/target/arm11.c index de9aecdd..0013db55 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -932,7 +932,8 @@ int arm11_step(struct target_s *target, int current, u32 address, int handle_bre u32 next_instruction; - arm11_read_memory_word(arm11, R(PC), &next_instruction); + if ((arm11_read_memory_word(arm11, R(PC), &next_instruction))!=ERROR_OK) + return retval; /* skip over BKPT */ if ((next_instruction & 0xFFF00070) == 0xe1200070) @@ -976,7 +977,8 @@ int arm11_step(struct target_s *target, int current, u32 address, int handle_bre brp[1].address = ARM11_SC7_BCR0; brp[1].value = 0x1 | (3 << 1) | (0x0F << 5) | (0 << 14) | (0 << 16) | (0 << 20) | (2 << 21); - arm11_sc7_run(arm11, brp, asizeof(brp)); + if ((retval=arm11_sc7_run(arm11, brp, asizeof(brp)))!=ERROR_OK) + return retval; /* resume */ @@ -987,7 +989,8 @@ int arm11_step(struct target_s *target, int current, u32 address, int handle_bre R(DSCR) |= ARM11_DSCR_INTERRUPTS_DISABLE; - arm11_leave_debug_state(arm11); + if ((retval=arm11_leave_debug_state(arm11))!=ERROR_OK) + return retval; arm11_add_IR(arm11, ARM11_RESTART, TAP_IDLE); @@ -1018,7 +1021,8 @@ int arm11_step(struct target_s *target, int current, u32 address, int handle_bre arm11_sc7_clear_vbw(arm11); /* save state */ - arm11_on_enter_debug_state(arm11); + if((retval = arm11_on_enter_debug_state(arm11))!=ERROR_OK) + return retval; /* restore default state */ R(DSCR) &= ~ARM11_DSCR_INTERRUPTS_DISABLE; -- cgit v1.2.3