From 290e01c62afdfd5f6eb76a4caef266344510f2c0 Mon Sep 17 00:00:00 2001 From: drath Date: Wed, 25 Jul 2007 10:06:57 +0000 Subject: - reformat src/jtag/bitq.c (thanks to Pavel Chromy) - fix multiple reads from FT2232 into same buffer location (thanks to Magnus Lundin) - retry JTAG chain validation (thanks to Magnus Lundin) - reworked GDB packet input handling (thanks to Pavel Chromy) - output error message when setting a watchpoint failed - removed duplicate out-of-bounds check in at91sam7.c (thanks to Pavel Chromy) git-svn-id: svn://svn.berlios.de/openocd/trunk@181 b42882b7-edfa-0310-969c-e2dbd0fdcd60 --- src/target/target.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src/target/target.c') diff --git a/src/target/target.c b/src/target/target.c index 07c450cd..10d430b9 100644 --- a/src/target/target.c +++ b/src/target/target.c @@ -1862,6 +1862,7 @@ int handle_rbp_command(struct command_context_s *cmd_ctx, char *cmd, char **args int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { target_t *target = get_current_target(cmd_ctx); + int retval; if (argc == 0) { @@ -1905,7 +1906,23 @@ int handle_wp_command(struct command_context_s *cmd_ctx, char *cmd, char **args, { data_mask = strtoul(args[4], NULL, 0); } - watchpoint_add(target, strtoul(args[0], NULL, 0), strtoul(args[1], NULL, 0), type, data_value, data_mask); + + if ((retval = watchpoint_add(target, strtoul(args[0], NULL, 0), + strtoul(args[1], NULL, 0), type, data_value, data_mask)) != ERROR_OK) + { + switch (retval) + { + case ERROR_TARGET_NOT_HALTED: + command_print(cmd_ctx, "target must be halted to set watchpoints"); + break; + case ERROR_TARGET_RESOURCE_NOT_AVAILABLE: + command_print(cmd_ctx, "no more watchpoints available"); + break; + default: + command_print(cmd_ctx, "unknown error, watchpoint not set"); + break; + } + } } else { -- cgit v1.2.3