From: Øyvind H. <go...@us...> - 2010-06-19 09:27:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 2a25c968bf4ffec39ee76da0a164e46bd4215134 (commit) from b8f8d756a255936ccfb60ac3dda076e4e06108a6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2a25c968bf4ffec39ee76da0a164e46bd4215134 Author: Ãyvind Harboe <oyv...@zy...> Date: Fri Jun 18 15:35:52 2010 +0200 cortex a8: fix segfault for unexamined targets print error message instead of segfaulting for unexamined targets. Signed-off-by: Ãyvind Harboe <oyv...@zy...> diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 4ee36ff..92469eb 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -232,6 +232,7 @@ struct dap_ops { static inline int dap_queue_idcode_read(struct adiv5_dap *dap, uint8_t *ack, uint32_t *data) { + assert(dap->ops != NULL); return dap->ops->queue_idcode_read(dap, ack, data); } @@ -250,6 +251,7 @@ static inline int dap_queue_idcode_read(struct adiv5_dap *dap, static inline int dap_queue_dp_read(struct adiv5_dap *dap, unsigned reg, uint32_t *data) { + assert(dap->ops != NULL); return dap->ops->queue_dp_read(dap, reg, data); } @@ -267,6 +269,7 @@ static inline int dap_queue_dp_read(struct adiv5_dap *dap, static inline int dap_queue_dp_write(struct adiv5_dap *dap, unsigned reg, uint32_t data) { + assert(dap->ops != NULL); return dap->ops->queue_dp_write(dap, reg, data); } @@ -283,6 +286,7 @@ static inline int dap_queue_dp_write(struct adiv5_dap *dap, static inline int dap_queue_ap_read(struct adiv5_dap *dap, unsigned reg, uint32_t *data) { + assert(dap->ops != NULL); return dap->ops->queue_ap_read(dap, reg, data); } @@ -298,6 +302,7 @@ static inline int dap_queue_ap_read(struct adiv5_dap *dap, static inline int dap_queue_ap_write(struct adiv5_dap *dap, unsigned reg, uint32_t data) { + assert(dap->ops != NULL); return dap->ops->queue_ap_write(dap, reg, data); } @@ -314,6 +319,7 @@ static inline int dap_queue_ap_write(struct adiv5_dap *dap, */ static inline int dap_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack) { + assert(dap->ops != NULL); return dap->ops->queue_ap_abort(dap, ack); } @@ -329,6 +335,7 @@ static inline int dap_queue_ap_abort(struct adiv5_dap *dap, uint8_t *ack) */ static inline int dap_run(struct adiv5_dap *dap) { + assert(dap->ops != NULL); return dap->ops->run(dap); } diff --git a/src/target/cortex_a8.c b/src/target/cortex_a8.c index 0b12abe..cfec48b 100644 --- a/src/target/cortex_a8.c +++ b/src/target/cortex_a8.c @@ -1839,10 +1839,13 @@ COMMAND_HANDLER(cortex_a8_handle_cache_info_command) COMMAND_HANDLER(cortex_a8_handle_dbginit_command) { struct target *target = get_current_target(CMD_CTX); + if (!target_was_examined(target)) + { + LOG_ERROR("target not examined yet"); + return ERROR_FAIL; + } - cortex_a8_init_debug_access(target); - - return ERROR_OK; + return cortex_a8_init_debug_access(target); } static const struct command_registration cortex_a8_exec_command_handlers[] = { ----------------------------------------------------------------------- Summary of changes: src/target/arm_adi_v5.h | 7 +++++++ src/target/cortex_a8.c | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |